Prevent stubbing of equals method
问题 I would like to test my class' equals() method but Mockito seems to be calling the stub version every time. My test is as follows; PluginResourceAdapter adapter = mock (PluginResourceAdapter.class); PluginResourceAdapter other = mock (PluginResourceAdapter.class); when(adapter.getNumberOfEndpointActivation()).thenReturn(1); when(other.getNumberOfEndpointActivation()).thenReturn(0); boolean result = adapter.equals(other); assertFalse(result); I know I cannot stub the equals method which means