title: How to call real methods in class instances annotated with @Injectable in JMockit?
body: <p>I'm looking for a way in JMockit to inject the private fields inside a class while maintaining the ability to trigger the real methods. I use <code>@Injectable</code> and <code>@Tested</code> offered by JMockit. But somehow after that the injected instance is not able to call the real method.</p>
  
  <p>Example test:</p>
  
  <pre><code>public class TestClass {
      public static class DoSomething {
          private Call callee;
  
          public void execute() {
              callee.call();
          }
      }
  
      public static class Call {
          public void call() {
              System.out.println("real");
          }
      }
  
      @Tested DoSomething doSomething;
      @Injectable Call call;
  
      // nothing happens
      @Test
      public void testRealCall() {
          doSomething.execute();
      }
  
      // invocation doesn't help either
      @Test
      public void testRealCallSecondTry() {
          new MockUp&lt;Call&gt;() {
              @Mock
              @SuppressWarnings("unused")
              public void call(Invocation inv) {
                  inv.proceed();
              }
          };
          doSomething.execute();
      }
  
      // this works, but requires redundant methods
      @Test
      public void testRealCallThirdTry() {
          new MockUp&lt;Call&gt;() {
              @Mock
              @SuppressWarnings("unused")
              public void call() {
                  System.out.println("real");
              }
          };
          doSomething.execute();
      }
  
      @Test
      public void testFakeCall() {
          new MockUp&lt;Call&gt;() {
              @Mock
              @SuppressWarnings("unused")
              public void call() {
                  System.out.println("fake");
              }
          };
          doSomething.execute();
      }
  }
  </code></pre>
  
  <p>Here <code>DoSomething</code> wraps the <code>Call</code> instance, which provides a way to print a message. The ideal output of the four test cases would be:</p>
  
  <pre><code>real
  real
  real
  fake
  </code></pre>
  
  <p>However the actual scenario is that only 3 and 4 worked, printing:</p>
  
  <pre><code>real
  fake
  </code></pre>
  
  <p>This shows if an instance is created using <code>@Injectable</code>. It's not able to directly call the original method without copying and pasting the old method body to the mocked version. That seems really awkward. Is there a workaround of this?</p>