### Question:
SimpleId implements Id, Serializable { @Override public int compareTo( final Id o ) { int compare = UUIDComparator.staticCompare( uuid, o.getUuid() ); if(compare == 0){ compare = type.compareTo( o.getType() ); } return compare; } @SuppressWarnings( "unused" )  SimpleId();  SimpleId( final UUID uuid, final String type );  SimpleId( final String type ); @Override UUID getUuid(); @Override String getType(); @SuppressWarnings( "unused" ) void setType( final String type ); @SuppressWarnings( "unused" ) void setUuid( final UUID uuid ); @Override boolean equals( final Object o ); @Override int hashCode(); @Override String toString(); @Override int compareTo( final Id o );  }### Answer:
@Test public void uuidComparison() { final UUID firstId = UUIDGenerator.newTimeUUID(); final UUID secondId = UUIDGenerator.newTimeUUID(); final String type = "test"; SimpleId first = new SimpleId( firstId, type ); SimpleId second = new SimpleId( secondId, type ); assertTrue( first.compareTo( second ) < 0 ); assertTrue( first.compareTo( first ) == 0 ); assertTrue( second.compareTo( first ) > 0 ); }
@Test public void typeComparison() { final UUID uuid = UUIDGenerator.newTimeUUID(); final String firstType = "test1"; final String secondType = "test2"; SimpleId first = new SimpleId( uuid, firstType ); SimpleId second = new SimpleId( uuid, secondType ); assertTrue( first.compareTo( second ) < 0 ); assertTrue( first.compareTo( first ) == 0 ); assertTrue( second.compareTo( first ) > 0 ); }