### Question:
UUIDGenerator { public static String nextHex(int type) { return Base16Encoder.encode(next(type)); }  static byte[] next(int type); static byte[] createType1(); static String nextString(int type); static String nextHex(int type); static final int TYPE1; static final int TYPE4; }### Answer:
@Test public void testUniqueHex() { Set seen = new HashSet(); for (int i = 0; i < 10000; i++) assertTrue(seen.add( UUIDGenerator.nextHex(UUIDGenerator.TYPE1))); }
@Test public void testUniqueType4Hex() { Set seen = new HashSet(); for (int i = 0; i < 10000; i++) assertTrue(seen.add( UUIDGenerator.nextHex(UUIDGenerator.TYPE4))); }
@Test public void testUniqueMixedTypesHex() { Set seen = new HashSet(); for (int i = 0; i < 10000; i++) { int type = (i % 2 == 0) ? UUIDGenerator.TYPE4 : UUIDGenerator.TYPE1; assertTrue(seen.add( UUIDGenerator.nextHex(type))); } }