private String hash(String password, String salt) {
        return PREFIX + BCrypt.hashpw(password, salt) + SALT_PREFIX + salt;
    }
@Test
    public void testHash() throws Exception {
        final String clearTextPassword = "foobar";
        final String hashedPassword = bCryptPasswordAlgorithm.hash(clearTextPassword);

        assertThat(hashedPassword)
                .isNotEmpty()
                .startsWith("{bcrypt}")
                .contains("{salt}");

        assertThat(bCryptPasswordAlgorithm.matches(hashedPassword, clearTextPassword)).isTrue();
    }