title: Mockito verify method call inside void method
body: <p>I have the following class and method get which I want to test:</p>
  
  <pre><code>public class MyClass{
      private MyObject svc;
      private MyObject2 svc2;
  
      public MyClass(MyObject svc){
          this.svc = svc;
          this.svc2 = new MyObject2(svc);
      }
  
  
      public void getSvc(){
          Result response = this.svc.getResponse();
          if(!response.isEmpty())
               this.svc2.filterResponse(response);
          else
              System.out.println("empty");
      }
  
  }
  </code></pre>
  
  <p>But I am struggling with being void method. How can I test that filterResponse will only get called when my response is not empty?</p>