### Question:
AnalyticUUIDGeneratorFactory { public static String generateHexUnif(int n) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) { Character c = HEX_ALPHA.charAt(r.nextInt(HEX_ALPHA_LEN)); sb.append(c); } return sb.toString(); } AnalyticUUIDGeneratorFactory();  AnalyticUUIDGeneratorFactory(Communication comm);  AnalyticUUIDGeneratorFactory(java.util.UUID uuid); AnalyticUUIDGenerator create(); final String getUuidString(); final java.util.UUID getUuid(); static String generateHexUnif(int n); static final String HEX_ALPHA; static final int HEX_ALPHA_LEN; }### Answer:
@Test public void testHexUnifLen() { String res = AnalyticUUIDGeneratorFactory.generateHexUnif(21); assertEquals(21, res.length()); Set<Character> charSet = new HashSet<>(); for (int i = 0; i < res.length(); i++) charSet.add(res.charAt(i)); assertTrue(charSet.size() > 1); }
@Test public void testHexUnifSpread() { int n = 1000; int m = 32; Set<String> outs = new HashSet<>(n); for (int i = 0; i < n; i++) outs.add(AnalyticUUIDGeneratorFactory.generateHexUnif(m)); assertEquals(1000, outs.size()); }