1 /* 2 * Copyright (c) 2017 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 package org.mockito.internal.creation; 6 7 import org.junit.Test; 8 import org.mockito.Mockito; 9 10 import static org.junit.Assert.assertEquals; 11 12 public class InterfaceOverrideTest { 13 14 public interface CloneableInterface extends Cloneable { 15 clone()16 CloneableInterface clone(); 17 } 18 19 @Test inherit_public_method_from_interface()20 public void inherit_public_method_from_interface() { 21 CloneableInterface i = Mockito.mock(CloneableInterface.class); 22 Mockito.when(i.clone()).thenReturn(i); 23 24 assertEquals(i, i.clone()); 25 } 26 } 27