SHAUtil { public static String randomString() { String text = ""; int i = 0; while (i < 16) { text += POSSIBLE.charAt((int)(Math.random() * POSSIBLE.length())); i++; } return text; } private  SHAUtil(); static String buildUniqueLink(String accountToken, String endUserEmail, long date, String randomString); static String randomString();  }
@Test public void checkRandomString() throws Exception { String randomString = SHAUtil.randomString(); assertThat(randomString).isNotNull(); assertThat(randomString.length() == 16).isTrue(); assertThat(randomString).matches("^[a-z0-9]{16}"); }