diff --git a/projects/Mockito/24/org/mockito/internal/stubbing/defaultanswers/ReturnsEmptyValues.java b/projects/Mockito/24/org/mockito/internal/stubbing/defaultanswers/ReturnsEmptyValues.java index 4c00f50..d19fcda 100644 --- a/projects/Mockito/24/org/mockito/internal/stubbing/defaultanswers/ReturnsEmptyValues.java +++ b/projects/Mockito/24/org/mockito/internal/stubbing/defaultanswers/ReturnsEmptyValues.java @@ -73,7 +73,7 @@ public Object answer(InvocationOnMock invocation) { //see issue 184. //mocks by default should return 0 if references are the same, otherwise some other value because they are not the same. Hence we return 1 (anything but 0 is good). //Only for compareTo() method by the Comparable interface - return 1; + return invocation.getMock() == invocation.getArguments()[0] ? 0 : 1; } Class returnType = invocation.getMethod().getReturnType();