title: Java testing verifying constructor
body: <p>I am trying to figure out a way to verify a class constructor in the following way (keep in mind this is a theoretical example)</p>
  
  <pre><code>public MyClass extends ItemContainer {
  
     public MyClass(RoundItem a, SquareItem b) {
        addItem(a);
        addItem(b); 
     }
  }
  </code></pre>
  
  <p>I would like to verify that the constructor called addItem once with any(RoundItem.class) and once with any(SquareItem.class). I can't seem to find a good way to verify a constructor in such a way with PowerMock or Mockito. Any ideas?</p>