title: jmockit class cast exception
body: <p>I'm trying to mock some webogic classes and interfaces to test a method that does this:</p>
  
  <pre><code>void init(oracle.wsm.policy.model.IAssertion assertion,....) {
  ...    
  oracle.wsm.policy.model.IAssertionBindings bindings = ((oracle.wsm.policy.model.impl.SimpleAssertion) assertion).getBindings();
  ...
  }
  </code></pre>
  
  <p>And my test code looks like this:</p>
  
  <pre><code>  @Test
    public final void testInit() {
  
  
    IAssertion assertionMock = new MockUp&lt;IAssertion&gt;() {
        @Mock
        QName getQName() {
          return new QName("qname");
        }
     }.getMockInstance();
  
  
     CustomAuditPolicy custom = new CustomAuditPolicy();
     custom.init(assertionMock);
  </code></pre>
  
  <p>And I'm getting:</p>
  
  <pre><code>java.lang.ClassCastException: $Impl_IAssertion cannot be cast to oracle.wsm.policy.model.impl.SimpleAssertion
      at xxx.CustomAuditPolicy.init(CustomAuditPolicy.java:82)
      at xxx.CustomAuditPolicyTest.testGetAssertionName(CustomAuditPolicyTest.java:190)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
  </code></pre>
  
  <p>The SimpleAssertion class implements IAssertion so I've been trying to mock the SimpleAssertion class as well but still getting the same error.</p>
  
  <p>Can someone explain me how to use jmockit in such scenario?</p>