public boolean authenticate(String user, String password)
    {
        return cache.getUnchecked(new Credential(user, password));
    }
@Test
    public void testAuthenticate()
    {
        PasswordStore store = createStore("userbcrypt:" + BCRYPT_PASSWORD, "userpbkdf2:" + PBKDF2_PASSWORD);

        assertTrue(store.authenticate("userbcrypt", "user123"));
        assertFalse(store.authenticate("userbcrypt", "user999"));
        assertFalse(store.authenticate("userbcrypt", "password"));

        assertTrue(store.authenticate("userpbkdf2", "password"));
        assertFalse(store.authenticate("userpbkdf2", "password999"));
        assertFalse(store.authenticate("userpbkdf2", "user123"));

        assertFalse(store.authenticate("baduser", "user123"));
        assertFalse(store.authenticate("baduser", "password"));
    }