### Question:
PasswordStore { private static RuntimeException invalidFile(int lineNumber, String message, Throwable cause) { return new PrestoException(CONFIGURATION_INVALID, format("Error in password file line %s: %s", lineNumber, message), cause); } PasswordStore(File file, int cacheMaxSize); @VisibleForTesting  PasswordStore(List<String> lines, int cacheMaxSize); boolean authenticate(String user, String password);  }### Answer:
@Test public void testInvalidFile() { assertThatThrownBy(() -> createStore("", "junk")) .hasMessage("Error in password file line 2: Expected two parts for user and password"); assertThatThrownBy(() -> createStore("abc:" + BCRYPT_PASSWORD, "xyz:" + BCRYPT_PASSWORD, "abc:" + PBKDF2_PASSWORD)) .hasMessage("Error in password file line 3: Duplicate user: abc"); assertThatThrownBy(() -> createStore("x:x")) .hasMessage("Error in password file line 1: Password hashing algorithm cannot be determined"); assertThatThrownBy(() -> createStore("x:$2y$xxx")) .hasMessage("Error in password file line 1: Invalid BCrypt password"); assertThatThrownBy(() -> createStore("x:x:x")) .hasMessage("Error in password file line 1: Invalid PBKDF2 password"); }