title: How to mock a function which does not return anything in java
body: <pre><code>public class Service1 {
  
  private Service2 service2;
  
  // FunctionA
  private FuncA(Object1 obj1) {
  
      /*
      code to make Obj2 from Obj1
      */
  
      service2.FuncB(obj2);
    }
  
  }
  
  public class Service2 {
    // FunctionB
    private FuncB(Object2 obj) {
      obj.field=value;  
    }
  
  }
  </code></pre>
  
  <p>I am trying to write Unit Test Case for Func A (as mentioned above) and for that need to mock Func B(as mentioned above).
  Pls. help how can I do that in Java 7.</p>
  
  <p>Ps. Newbie to Java</p>