### Question:
SnowflakeUID extends UID { @Override public int compareTo(final UID uid) { int result; if (uid instanceof SnowflakeUID) { final SnowflakeUID o = (SnowflakeUID) uid; final CompareToBuilder compare = new CompareToBuilder(); if (null == this.snowflake) { compare.append(TOO_BIG_BIGINT, o.snowflake); } else if (null == o.snowflake) { compare.append(this.snowflake, TOO_BIG_BIGINT); } else { compare.append(this.snowflake, o.snowflake); } compare.append(this.extra, o.extra); result = compare.toComparison(); } else if (null != uid) { result = toString().compareTo(uid.toString()); } else { result = -1; } return result; } protected  SnowflakeUID(); protected  SnowflakeUID(final BigInteger rawId, int radix, final String... extras); protected  SnowflakeUID(final SnowflakeUID template, final String... extras); @SuppressWarnings({"unchecked", "rawtypes"}) static UIDBuilder<UID> builder(); @Override int compareTo(final UID uid); @Override boolean equals(final Object other); @Override int getTime(); @Override String getBaseUid(); int getMachineId(); int getNodeId(); int getProcessId(); int getRadix(); int getSequenceId(); @Override String getShardedPortion(); int getThreadId(); long getTimestamp(); @Override int hashCode(); @SuppressWarnings("unchecked") static SnowflakeUID parse(final String s); @SuppressWarnings("unchecked") static SnowflakeUID parse(final String s, int maxExtraParts); static SnowflakeUID parse(final String s, int radix, int maxExtraParts); @SuppressWarnings("unchecked") static SnowflakeUID parseBase(final String s); @Override void readFields(final DataInput in); @Override String toString(); String toString(int radix); static final int DEFAULT_RADIX; static final long MAX_TIMESTAMP; static final int MAX_NODE_ID; static final int MAX_PROCESS_ID; static final int MAX_THREAD_ID; static final int MAX_MACHINE_ID; static final int MAX_SEQUENCE_ID; }### Answer:
@Test public void testComparisons() { UID a = builder.newId(data.getBytes()); UID b = builder.newId(data2.getBytes()); assertTrue(a.compareTo(b) < 0); assertTrue(b.compareTo(a) > 0); a = builder.newId(data.getBytes(), "blabla.blabla"); b = builder.newId(data2.getBytes(), "blabla.blabla"); assertTrue(a.compareTo(b) < 0); assertTrue(b.compareTo(a) > 0); a = builder.newId(data.getBytes(), "blabla.blabla"); b = builder.newId(data2.getBytes(), "blebla.blabla"); assertTrue(a.compareTo(b) < 0); assertTrue(b.compareTo(a) > 0); }