@Test public void compareToTest() { var windowOne = new Window(1); var windowTwo = new Window(2); assertTrue(windowOne.compareTo(windowTwo) < 0); assertTrue(windowTwo.compareTo(windowOne) > 0); var windowOneAgain = new Window(1); assertEquals(0, windowOne.compareTo(windowOneAgain)); assertEquals(0, windowOneAgain.compareTo(windowOne)); }
@Override public int compareTo(Window o) { return Long.compare(getId(), o.getId()); }
Window extends BaseCustomIdType implements Comparable<Window> { @Override public int compareTo(Window o) { return Long.compare(getId(), o.getId()); } }
Window extends BaseCustomIdType implements Comparable<Window> { @Override public int compareTo(Window o) { return Long.compare(getId(), o.getId()); } Window(long id); }
Window extends BaseCustomIdType implements Comparable<Window> { @Override public int compareTo(Window o) { return Long.compare(getId(), o.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 compareTo(Window o) { return Long.compare(getId(), o.getId()); } Window(long id); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Window o);  }