Why assertEquals and assertSame in junit return the same result for two instances same class?
问题 According to documentation assertEquals() Asserts that two objects are equal. assertSame() Asserts that two objects refer to the same object. So I am expecting that if I have a class like below class SomeClass {} then SomeClass someClass1= new SomeClass(); SomeClass someClass2= new SomeClass(); assertSame(someClass1,someClass2); // fail assertEquals(someClass1,someClass2); // fail the assertEquals should pass and assertSame should fail, as the value of both classes are equal but they have