### Question:
PasswordStrengthUtil { public int computeRate(CharSequence password) { if (password == null || password.length() < minPwLength) { return -1; } else { int numCharsToRate = Math.min(PW_TRUNC_LEN, password.length()); return zxcvbn.measure(password.subSequence(0, numCharsToRate), SANITIZED_INPUTS).getScore(); } } @Inject  PasswordStrengthUtil(ResourceBundle resourceBundle, Environment environment); boolean fulfillsMinimumRequirements(CharSequence password); int computeRate(CharSequence password); String getStrengthDescription(Number score);  }### Answer:
@Test public void testLongPasswords() { PasswordStrengthUtil util = new PasswordStrengthUtil(Mockito.mock(ResourceBundle.class), Mockito.mock(Environment.class)); String longPw = Strings.repeat("x", 10_000); Assertions.assertTimeout(Duration.ofSeconds(5), () -> { util.computeRate(longPw); }); }
@Test @Disabled("waiting on upstream fix") public void testIssue979() { PasswordStrengthUtil util = new PasswordStrengthUtil(Mockito.mock(ResourceBundle.class), Mockito.mock(Environment.class)); int result1 = util.computeRate("backed derrick buckling mountains glove client procedures desire destination sword hidden ram"); int result2 = util.computeRate("backed derrick buckling mountains glove client procedures desire destination sword hidden ram escalation"); Assertions.assertEquals(4, result1); Assertions.assertEquals(4, result2); }