### Question:
Pbkdf2 extends HexSaltedMethod { @Override public boolean comparePassword(String password, HashedPassword hashedPassword, String unusedName) { String[] line = hashedPassword.getHash().split("\\$"); if (line.length != 4) { return false; } int iterations; try { iterations = Integer.parseInt(line[1]); } catch (NumberFormatException e) { ConsoleLogger.logException("Cannot read number of rounds for Pbkdf2", e); return false; } String salt = line[2]; byte[] derivedKey = BinTools.hex2bin(line[3]); PBKDF2Parameters params = new PBKDF2Parameters("HmacSHA256", "UTF-8", salt.getBytes(), iterations, derivedKey); PBKDF2Engine engine = new PBKDF2Engine(params); return engine.verifyKey(password); } @Inject  Pbkdf2(Settings settings); @Override String computeHash(String password, String salt, String name); @Override boolean comparePassword(String password, HashedPassword hashedPassword, String unusedName); @Override int getSaltLength();  }### Answer:
@Test public void shouldDetectMatchForHashWithOtherRoundNumber() { Pbkdf2 pbkdf2 = new Pbkdf2(mockSettings()); String hash = "pbkdf2_sha256$4128$3469b0d48b702046$DC8A54351008C6054E12FB19E0BF8A4EA6D4165E0EDC97A1ECD15231037C382DE5BF85D07D5BC9D1ADF9BBFE4CE257C6059FB1B9FF65DB69D8B205F064BE0DA9"; String clearText = "PassWord1"; boolean isMatch = pbkdf2.comparePassword(clearText, new HashedPassword(hash), ""); assertThat(isMatch, equalTo(true)); }