title: Mockito : how to verify method was called on an object created within a method?
body: <p>I am new to Mockito.</p>
  
  <p>Given the class below, how can I use Mockito to verify that <code>someMethod</code> was invoked exactly once after <code>foo</code> was invoked?</p>
  
  <pre><code>public class Foo
  {
      public void foo(){
          Bar bar = new Bar();
          bar.someMethod();
      }
  }
  </code></pre>
  
  <p>I would like to make the following verification call,</p>
  
  <pre><code>verify(bar, times(1)).someMethod();
  </code></pre>
  
  <p>where <code>bar</code> is a mocked instance of <code>Bar</code>.</p>