/**
 * @file IncomeCalculator.java
 * @author Valery Samovich
 * @version 1.0.0
 * @date 12/16/2014
 *
 * Using the Easymock and JUnit
 */

package com.valerysamovich.java.advanced.easymock;

public class IncomeCalculator {

    // Private fields
    private ICalculatorMethod calculatorMethod;
    private Position position;

    // Setter for I CalculatorMethod
    public void setCalculatorMethod(ICalculatorMethod calculatorMethod) {
        this.calculatorMethod = calculatorMethod;
    }
}



@@ -342,10 +342,17 @@
 for 
+private 
 I
- 
 Calc
@@ -363,16 +363,32 @@
 orMethod
+ field (object).
 %0A    pub
@@ -454,16 +454,16 @@
 thod) %7B%0A
-
         
@@ -509,13 +509,532 @@
 d;%0A    %7D
+%0A%0A    // Setter for private Position filed (object).%0A    public void setPosition(Position position) %7B%0A        this.position = position;%0A    %7D%0A    /*%0A     * Calculate method.%0A     */%0A    public double calculate() %7B%0A%0A        if(calculatorMethod == null) %7B%0A            throw new RuntimeException(%22CalculatorMethod not yet maintained.%22);%0A        %7D%0A%0A        if(position == null) %7B%0A            throw new RuntimeException(%22Position not yet maintained.%22);%0A        %7D%0A%0A        return calculatorMethod.calculator(position);%0A%0A    %7D
 %0A%7D%0A%0A%0A

Add setters for private fields and calculate method.