@Test void build() { String last = null; HashSet<Object> digests = new HashSet<>(); for (int i = 0; i < 100; i++) { String pwd = RandomSecret.create(); char[] chars = pwd.toCharArray(); assertNotNull(pwd); assertEquals(32, pwd.length()); assertNotEquals(last, pwd); for (int j = 0; j < pwd.length(); j++) { char c = chars[j]; assertTrue(c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'); } assertFalse(digests.contains(pwd)); digests.add(pwd); last = pwd; } }
public static String create() { return create(32); }
RandomSecret { public static String create() { return create(32); } }
RandomSecret { public static String create() { return create(32); } private  RandomSecret(); }
RandomSecret { public static String create() { return create(32); } private  RandomSecret(); static String create(); static String create(int length); }
RandomSecret { public static String create() { return create(32); } private  RandomSecret(); static String create(); static String create(int length);  }