User (final String username, final String password ) { if (!isUsernameValid(username)) { throw new IllegalArgumentException("Invalid username!"); } if (!isPasswordValid(password)) { throw new IllegalArgumentException("Invalid password!"); } assert (username != null) && (password != null); return searchLoginTable(username.toLowerCase(), password.toCharArray()); }