Difference between 'same' and 'eq' in EasyMock
问题 Is there a significant(or even any) difference between 'same' and 'eq' in EasyMock? 回答1: same checks if both objects are actually the same instance (reference equality). eq calls equals and therefore checks if both have the same value (value equality). Keep in mind that the default equals implementation uses == internally, and therefore eq will do the same as same if you're using classes that do not have a proper equals override. But still, it's better to state your intent by using same for