Created
September 25, 2018 15:44
-
-
Save lovasoa/3b813a0cfd1a496f58c90a70b16f3200 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@org.junit.Test | |
public void testClasses() { | |
class A { | |
} | |
A a = new A(); | |
assertEquals(a, a); | |
assertTrue(new A[]{a, a, a}.equals(new A[]{a, a, a})); | |
assertEquals(new A(), new A()); | |
} | |
@Test | |
public void testClassB() { | |
class B { | |
@Override | |
public boolean equals(Object other) { | |
return true; | |
} | |
} | |
assertEquals(new B(), new B()); | |
assertEquals(new B().toString(), new B().toString()); // This is a hard one | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment