### Question:
AbstractID implements Comparable<AbstractID>, java.io.Serializable { @Override public int compareTo(AbstractID o) { int diff1 = Long.compare(this.upperPart, o.upperPart); int diff2 = Long.compare(this.lowerPart, o.lowerPart); return diff1 == 0 ? diff2 : diff1; } AbstractID(byte[] bytes);  AbstractID(long lowerPart, long upperPart);  AbstractID(AbstractID id);  AbstractID(); long getLowerPart(); long getUpperPart(); byte[] getBytes(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); @Override int compareTo(AbstractID o); static final int SIZE; }### Answer:
@Test public void testCompare() throws Exception { AbstractID id1 = new AbstractID(0, 0); AbstractID id2 = new AbstractID(1, 0); AbstractID id3 = new AbstractID(0, 1); AbstractID id4 = new AbstractID(-1, 0); AbstractID id5 = new AbstractID(0, -1); AbstractID id6 = new AbstractID(-1, -1); AbstractID id7 = new AbstractID(Long.MAX_VALUE, Long.MAX_VALUE); AbstractID id8 = new AbstractID(Long.MIN_VALUE, Long.MIN_VALUE); AbstractID id9 = new AbstractID(Long.MAX_VALUE, Long.MIN_VALUE); AbstractID id10 = new AbstractID(Long.MIN_VALUE, Long.MAX_VALUE); assertEquals(0, id1.compareTo(CommonTestUtils.createCopySerializable(id1))); assertEquals(0, id2.compareTo(CommonTestUtils.createCopySerializable(id2))); assertEquals(0, id3.compareTo(CommonTestUtils.createCopySerializable(id3))); assertEquals(0, id4.compareTo(CommonTestUtils.createCopySerializable(id4))); assertEquals(0, id5.compareTo(CommonTestUtils.createCopySerializable(id5))); assertEquals(0, id6.compareTo(CommonTestUtils.createCopySerializable(id6))); assertEquals(0, id7.compareTo(CommonTestUtils.createCopySerializable(id7))); assertEquals(0, id8.compareTo(CommonTestUtils.createCopySerializable(id8))); assertEquals(0, id9.compareTo(CommonTestUtils.createCopySerializable(id9))); assertEquals(0, id10.compareTo(CommonTestUtils.createCopySerializable(id10))); assertCompare(id1, id2, -1); assertCompare(id1, id3, -1); assertCompare(id1, id4, 1); assertCompare(id1, id5, 1); assertCompare(id1, id6, 1); assertCompare(id2, id5, 1); assertCompare(id3, id5, 1); assertCompare(id2, id6, 1); assertCompare(id3, id6, 1); assertCompare(id1, id7, -1); assertCompare(id1, id8, 1); assertCompare(id7, id8, 1); assertCompare(id9, id10, -1); assertCompare(id7, id9, 1); assertCompare(id7, id10, 1); assertCompare(id8, id9, -1); assertCompare(id8, id10, -1); }