public static boolean checkpw(String plaintext, String hashed) {
        return equalsNoEarlyReturn(hashed, hashpw(plaintext, hashed));
    }
@Test
    public void testCheckpw() {
        Assert.assertFalse(BCrypt.checkpw("foo", "$2a$10$......................"));

        final String hashed = BCrypt.hashpw("foo", BCrypt.gensalt());
        Assert.assertTrue(BCrypt.checkpw("foo", hashed));
        Assert.assertFalse(BCrypt.checkpw("bar", hashed));
    }