### Question:
CollectClientConnectionsFilter implements org.forgerock.http.Filter, Closeable { String[] parseUsernamePassword(String authHeader) throws ResourceException { if (authHeader != null && (authHeader.startsWith("Basic") || authHeader.startsWith("basic"))) { String base64UserCredentials = authHeader.substring("basic".length() + 1); try { String userCredentials = new String(Base64.decode(base64UserCredentials)); String[] split = userCredentials.split(":"); if (split.length == 2) { return split; } } catch (ParseException e) { throw Rest2LDAP.asResourceException(e); } } return null; } CollectClientConnectionsFilter(ServerContext serverContext, HTTPConnectionHandler connectionHandler,
      HTTPAuthenticationConfig authenticationConfig); @Override Promise<Response, NeverThrowsException> filter(Context context, Request request, Handler next); @Override void close();  }### Answer:
@Test(dataProvider = "Invalid HTTP basic auth strings") public void parseUsernamePasswordFromInvalidAuthZHeader(String authZHeader) throws Exception { assertThat(filter.parseUsernamePassword(authZHeader)).isNull(); }
@Test(dataProvider = "Valid HTTP basic auth strings") public void parseUsernamePasswordFromValidAuthZHeader(String authZHeader) throws Exception { assertThat(filter.parseUsernamePassword(authZHeader)).containsExactly(USERNAME, PASSWORD); }