title: Can PowerMock instantiate an inner class for test cases?
body: <p>I'm attempting to test a class with a number of private classes (yes, I know this is generally considered poor practice for testability, but this question is not in regards to design principles).  My class would look something like this:</p>
  
  <pre><code>public class EnclosingClass {
    .
    .
    .
    private class InnerClass implements InnerClassType {
       public InnerClass(){ /* do stuff */}
       public int InnerClassMethod();
    }
  }
  </code></pre>
  
  <ul>
  <li><code>InnerClassType</code> is a public interface</li>
  </ul>
  
  <p>I've tried instantiating the classes with powermock by doing:</p>
  
  <pre><code>Class clazz = Whitebox.getInnerClassType(EnclosingClass.class, "InnerClass");
  Constructor constructor = Whitebox.getConstructor(clazz, null);
  InnerClassType innerClass = (InnerClassType) constructor.newInstance(null);
  </code></pre>
  
  <p>and also:</p>
  
  <pre><code>Class clazz = Whitebox.getInnerClassType(EnclosingClass.class, "InnerClass");
  InnerClassType innerClass = (InnerClassType) Whitebox.invokeConstructor(clazz);
  </code></pre>
  
  <p>However, on both attempts I get a <code>ConstructorNotFoundException</code></p>
  
  <p>Is it possible to instantiate these inner classes?  If so, where am I going wrong?</p>