title: how do I use powermockito verifyNew?
body: <p>Having trouble with this. I've used Powermockito quite a bit in the past. Normally this is pretty smooth. I figured I'd post my problem rather than continue to rummage through examples. So the goal is to verify a call to new for a class. I don't think this is the most popular feature of powermockito. 
  Here's the test:</p>
  
  <pre><code>import static org.powermock.api.mockito.PowerMockito.verifyNew;
  import static org.powermock.api.mockito.PowerMockito.whenNew;
  
  @RunWith(PowerMockRunner.class)
  @PrepareForTest(ClassUnderTest.class)
  public class VerifyNewTest {
  
    ClassUnderTest myClassUnderTest = new ClassUnderTest();
  
    @Before
    public void setUp() throws Exception {
    }
  
    @Test
    public void test() throws Exception {
      whenNew(Collaborator.class).withNoArguments().thenReturn(new Collaborator());
      myClassUnderTest.doSomething();
      verifyNew(Collaborator.class).withNoArguments();
    }
  
  }
  </code></pre>
  
  <p>and said classes</p>
  
  <pre><code>public class ClassUnderTest {
  
    public void doSomething() {
      new Collaborator();
    }
  }
  
  
  public class Collaborator {
  
  }
  </code></pre>
  
  <p>My goal was to make this as simple as possible. I suppose I could have added some mock objects and stubbed some behavior. Anyway, I get.</p>
  
  <pre><code>org.mockito.exceptions.misusing.UnfinishedStubbingException:  Unfinished stubbing detected here:
      -&gt; at org.powermock.api.mockito.internal.invocationcontrol. MockitoNewInvocationControl.expectSubstitutionLogic(MockitoNewInvocationControl.java:65)
  </code></pre>
  
  <p><br>
  E.g. <code>thenReturn()</code> may be missing.
  Examples of correct stubbing:</p>
  
  <pre><code>when(mock.isOk()).thenReturn(true);
  when(mock.isOk()).thenThrow(exception);
  doThrow(exception).when(mock).someVoidMethod();
  </code></pre>
  
  <p><p>
  Hints:<br>
   1. missing <code>thenReturn()</code><br>
   2. you are trying to stub a final method, you naughty developer!
  <p></p>