title: Resetting Mockito Spy
body: <p>I have a test class (based on TestNG) where I use <code>Mockito.verify</code> for a spy object. </p>
  
  <p>This works:</p>
  
  <pre><code>public class Program {
      @Spy
      private TestObject testObject;
  
      @Test
      public void test1() {
         testObject.makeSth(); 
         verify(testObject, only()).someMethodNeedToBeChecked(); 
      }
  }
  </code></pre>
  
  <p>But here:</p>
  
  <pre><code>public class Program {
      @Spy
      private TestObject testObject;
  
      @Test
      public void test1() {
         testObject.makeSth(); 
         verify(testObject, only()).someMethodNeedToBeChecked(); 
      }
  
      @Test
      public void test2() {
          // Some different scenario
         testObject.makeSth(); 
         verify(testObject, only()).someMethodNeedToBeChecked(); 
          ...
      }
  }
  </code></pre>
  
  <p>I get a Mokito exception that I have more that one invocation of <code>someMethodNeedToBeChecked</code> method. Of course I tried to add <code>Mockito.reset(testObject)</code> but it didn't help me at all.</p>
  
  <p>How can I reset a spy object if I need to verify the same method in several tests?</p>