### Question:
BCrypt { public static boolean checkpw(String plaintext, String hashed) { return equalsNoEarlyReturn(hashed, hashpw(plaintext, hashed)); }  static String hashpw(String password, String salt); static String gensalt(int log_rounds, SecureRandom random); static String gensalt(int log_rounds); static String gensalt(); static boolean checkpw(String plaintext, String hashed);  }### Answer:
@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)); }