UUID { public static String uuid(int len) { return uuid(len, CHARS.length); }  static String uuid(int len); static String uuid(int len,
                              int radix); static String uuid();  }
@Test public void hasFiveGroups() throws Exception { final String uuid = UUID.uuid(); final String[] split = uuid.split("-"); assertEquals(5, split.length); }
@Test public void generateWithGivenLength() throws Exception { assertEquals(12, UUID.uuid(12) .length()); assertEquals(6, UUID.uuid(6) .length()); assertEquals(100, UUID.uuid(100) .length()); }
@Test(expected = IllegalArgumentException.class) public void tooLongRadix() throws Exception { UUID.uuid(10, 63); }
@Test public void generateWithGivenLengthAndRadix() throws Exception { assertOnlyContainsCharacters(UUID.uuid(10, 2), "0", "1"); }