code: public static HttpHandler wrapBasicAuthentication(HttpHandler httpHandler, String username, String password) {
          Objects.requireNonNull(httpHandler, Required.HTTP_HANDLER.toString());
          Objects.requireNonNull(username, Required.USERNAME.toString());
          Objects.requireNonNull(password, Required.PASSWORD.toString());
          
          HttpHandler wrap = new AuthenticationCallHandler(httpHandler);
          wrap = new AuthenticationConstraintHandler(wrap);
          wrap = new AuthenticationMechanismsHandler(wrap, Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism("Authentication required")));
          
          return new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, new Identity(username, password), wrap);
      }
docs: Adds a Wrapper to the handler when the request requires authentication
  
  @param httpHandler The Handler to wrap
  @param username The username to use
  @param password The password to use
  @return An HttpHandler wrapped through BasicAuthentication