### Question:
AuthenticationTokenUtils { public static String generateSuccessfulAuthenticationMessage(final AuthenticationToken token) { final String username = extractUsername(token); final String remoteHostname = extractHostname(token); return String.format("Successful authentication attempt by %s from %s", username, remoteHostname); } private  AuthenticationTokenUtils(); static boolean isUsernamePasswordToken(final AuthenticationToken token); static String extractUsername(final AuthenticationToken token); static String extractHostname(final AuthenticationToken token); static String generateUnsuccessfulAuthenticationMessage(final AuthenticationToken token); static String generateSuccessfulAuthenticationMessage(final AuthenticationToken token);  }### Answer:
@Test public void testGenerateSuccessfulAuthenticationMessage() throws Exception { final UsernamePasswordToken successfulToken = new UsernamePasswordToken(); successfulToken.setUsername("successfulUser1"); successfulToken.setHost("successfulHost1"); assertEquals("Successful authentication attempt by successfulUser1 from successfulHost1", AuthenticationTokenUtils.generateSuccessfulAuthenticationMessage(successfulToken)); }