equals() Equals와 HashCode를 재정의하는 이유와 둘 사이에 관계에 대해 알아보자. Point라는 클래스가 있다고 가정한다. class Point { int x; int y; Point(int x, int y) { this.x = x; this.y = y; } } 그리고 아래의 테스트를 돌려보면 테스트가 깨진다. equals가 기본적으로 java core 라이브러리에 있는 equals로 동작하는데 내부적으로 참조(주소)를 기준으로 비교하기 때문이다. @Test void test() { Point point1 = new Point(1, 2); Point point2 = new Point(1, 2); Assertions.assertThat(point1).isEqualTo(point2); //..