title: Mocking interface clone method
body: <p>Mocking a <code>clone()</code> method on an interface appears to no longer be working with <strong>Mockito 2.1.0</strong>. The below code works fine with <strong>Mockito 1.10.19</strong> but throws an <code>IllegalAccessError</code> with <strong>Mockito 2.1.0</strong>:</p>
  
  <pre><code>public interface CloneableInterface extends Cloneable {
     CloneableInterface clone();
  }
  
  public class CloneableInterfaceTest {
  
     @Test
     public void test() {      
       CloneableInterface i = Mockito.mock(CloneableInterface.class);
       Mockito.when(i.clone()).thenReturn(i); // Throws IllegalAccessError
     }
  }
  </code></pre>
  
  <p>Result of running above test:</p>
  
  <pre><code>java.lang.IllegalAccessError: CloneableInterface$MockitoMock$833899610.clone()LCloneableInterface;
  </code></pre>
  
  <p>I checked the mockito bug list and googled a bit but found nothing. Wanted to check SO community first before filing a bug report with the mockito team.</p>
  
  <p>Environment: <strong>JDK 1.8.0_102</strong>, <strong>JUnit 4.11</strong>, <strong>Mockito 2.1.0</strong>, <strong>Gradle 3.0</strong>, <strong>Windows 10</strong></p>
  
  <p><strong>EDIT:</strong> Filed a bug with the mockito team <a href="https://github.com/mockito/mockito/issues/688" rel="nofollow">here</a></p>