### Question:
HashUID extends UID { @Override public int compareTo(final UID uid) { int result; if (uid instanceof HashUID) { final HashUID o = (HashUID) uid; final CompareToBuilder compare = new CompareToBuilder(); compare.append(this.optionalPrefix, o.optionalPrefix); compare.append(this.h1, o.h1); compare.append(this.h2, o.h2); compare.append(this.time, o.time); compare.append(this.extra, o.extra); result = compare.toComparison(); } else if (null != uid) { result = toString().compareTo(uid.toString()); } else { result = -1; } return result; } protected  HashUID(); protected  HashUID(final byte[] data, final Date time); protected  HashUID(final byte[] data, final Date time, final String... extras); protected  HashUID(final HashUID template, final String... extras); private  HashUID(final String optionalPrefix, int h1, int h2, int time, final String... extras); private  HashUID(final String optionalPrefix, int h1, int h2, int time); @SuppressWarnings({"unchecked", "rawtypes"}) static UIDBuilder<UID> builder(); @Override int compareTo(final UID uid); @Override boolean equals(Object other); String getBaseUid(); int getH0(); int getH1(); int getH2(); String getShardedPortion(); int getTime(); @Override int hashCode(); @SuppressWarnings({"unchecked", "rawtypes"}) static UIDBuilder<UID> newBuilder(final Date time); @SuppressWarnings("unchecked") static HashUID parse(String s); @SuppressWarnings("unchecked") static HashUID parse(String s, int maxExtraParts); @SuppressWarnings("unchecked") static HashUID parseBase(String s); void readFields(DataInput in); @Override String toString();  }### Answer:
@Test public void testComparisons() { UID a = new HashUID(data.getBytes(), (Date) null) {}; UID b = new HashUID(data2.getBytes(), (Date) null) {}; assertTrue(a.compareTo(b) != 0); a = new HashUID(data.getBytes(), null, "blabla.blabla") {}; b = new HashUID(data2.getBytes(), null, "blabla.blabla") {}; assertTrue(a.compareTo(b) != 0); a = new HashUID(data.getBytes(), null, "blabla.blabla") {}; b = new HashUID(data.getBytes(), null, "blebla.blabla") {}; assertTrue(a.compareTo(b) != 0); assertTrue(a.compareTo(null) != 0); assertEquals(0, a.compare(null, null)); assertTrue(a.compare(a, null) != 0); assertTrue(a.compare(null, a) != 0); }