### Question:
IdMapper { public static long toInternalID(UUID id) { if (id == null) throw new IllegalArgumentException("id must not be null."); if (id.getMostSignificantBits() != 0) throw new IllegalArgumentException("most significant bits must not be set."); if (id.getLeastSignificantBits() < 0) throw new IllegalArgumentException("least significant bits must not be negative."); return id.getLeastSignificantBits(); }  static UUID toGlobalID(long id); static long toInternalID(UUID id);  }### Answer:
@Test public void testToInternalId() { assertEquals(1, IdMapper.toInternalID(UUID.fromString("00000000-0000-0000-0000-000000000001"))); }
@Test(expected = IllegalArgumentException.class) public void testToInternalIdNullIdThrowsException() { IdMapper.toInternalID(null); }
@Test(expected = IllegalArgumentException.class) public void testToInternalIdMostSignificantBitsSetThrowsException() { IdMapper.toInternalID(new UUID(1, 1)); }
@Test(expected = IllegalArgumentException.class) public void testToInternalIdLeastSignificantBitsNegativeThrowsException() { IdMapper.toInternalID(new UUID(0, -1)); }