### Question:
HttpUtil { public static String authorizationHeaderValue(PasswordAuthentication creds) { String value = creds.getUserName() + ":" + new String(creds.getPassword()); return "Basic " + Base64.getEncoder().encodeToString(value.getBytes()); }  static String extractContentType(String headerValue); static String escapeUrl(RestRequestContainer request, Templater templater); static String authorizationHeaderValue(PasswordAuthentication creds);  }### Answer:
@Test void shouldEncodeCredentialsCorrectly() { assertThat(HttpUtil.authorizationHeaderValue(new PasswordAuthentication("aladdin", "opensesame".toCharArray()))) .isEqualTo("Basic YWxhZGRpbjpvcGVuc2VzYW1l"); }