PasswordUtil { public static String createSalt() { byte[] salt = new byte[32]; GENERATOR.nextBytes(salt); return Base64.encodeBase64String(salt); } private  PasswordUtil(); static String createSalt(); static String hash(final String password, final String salt); static Boolean isValid(final String password,
                                  final String salt,
                                  final String hashed);  }
@Test public void testCreateSalt() { String salt = PasswordUtil.createSalt(); assertEquals(44, salt.length()); String salt2 = PasswordUtil.createSalt(); assertNotEquals(salt, salt2); }