@@ -0,0 +1,1061 @@
+package org.mockitousage.bugs;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.mockito.Mockito;%0A%0A// see #508%0Apublic class DiamondInheritanceIsConfusingMockitoTest %7B%0A%0A    @Test%0A    public void should_work() %7B%0A        Sub mock = Mockito.mock(Sub.class);%0A        // The following line results in%0A        // org.mockito.exceptions.misusing.MissingMethodInvocationException:%0A        // when() requires an argument which has to be 'a method call on a mock'.%0A        // Presumably confused by the interface/superclass signatures.%0A        Mockito.when(mock.getFoo()).thenReturn(%22Hello%22);%0A%0A        Assert.assertEquals(%22Hello%22, mock.getFoo());%0A    %7D%0A%0A    public class Super%3CT%3E %7B%0A        private T value;%0A%0A        public Super(T value) %7B%0A            this.value = value;%0A        %7D%0A%0A        public T getFoo() %7B return value; %7D%0A    %7D%0A%0A    public class Sub%0A            extends Super%3CString%3E%0A            implements iInterface %7B%0A%0A        public Sub(String s) %7B%0A            super(s);%0A        %7D%0A    %7D%0A%0A    public interface iInterface %7B%0A        String getFoo();%0A    %7D%0A%7D

Test for bug reported in #508 it was fixed in c95d3af2791d4d513edbca74720e1a5e84930102