### Question:
DbUsernameConverterService { public String toDatabaseUsername(String username) { return StringUtils.substringBefore(username, "@"); }  String toConnectionUsername(String host, String dbUser); String toDatabaseUsername(String username);  }### Answer:
@Test public void testWhenToDatabaseUsername() { String username = dbUsernameConverterService.toDatabaseUsername("username@hostname"); assertEquals("username", username); }