@Test public void hashCodeTest() { var windowOne = new Window(1); var windowTwo = new Window(2); assertNotEquals(windowOne.hashCode(), windowTwo.hashCode()); var windowOneAgain = new Window(1); var windowOneSame = windowOne; assertEquals(windowOne.hashCode(), windowOneSame.hashCode()); assertEquals(windowOne.hashCode(), windowOneAgain.hashCode()); }
@Override public int hashCode() { return Objects.hash(getId()); }
Window extends BaseCustomIdType implements Comparable<Window> { @Override public int hashCode() { return Objects.hash(getId()); } }
Window extends BaseCustomIdType implements Comparable<Window> { @Override public int hashCode() { return Objects.hash(getId()); } Window(long id); }
Window extends BaseCustomIdType implements Comparable<Window> { @Override public int hashCode() { return Objects.hash(getId()); } Window(long id); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Window o); }
Window extends BaseCustomIdType implements Comparable<Window> { @Override public int hashCode() { return Objects.hash(getId()); } Window(long id); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Window o);  }