code: public boolean matches(final HTTPRequest request) {
          if (varyHeaders.containsKey("ALL")) return false;
          Headers headers = request.getAllHeaders();
  
          for (Map.Entry<String, String> varyEntry : varyHeaders.entrySet()) {
              if (request.getChallenge().isPresent() && varyEntry.getKey().equals(HeaderConstants.AUTHORIZATION)) {
                  if (!request.getChallenge().get().getIdentifier().equals(varyEntry.getValue())) {
                      return false;
                  }
              }
              else {
                  List<Header> requestHeaderValue = headers.getHeaders(varyEntry.getKey());
                  boolean valid = requestHeaderValue.isEmpty() ? varyEntry.getValue() == null : headers.getFirstHeader(varyEntry.getKey()).get().getValue().equals(varyEntry.getValue());
                  if (!valid) {
                      return false;
                  }
              }
          }
          List<Preference> preferences = new ArrayList<>();
          preferences.addAll(headers.getAccept());
          preferences.addAll(headers.getAcceptCharset());
          preferences.addAll(headers.getAcceptLanguage());
  
          return !(varyHeaders.isEmpty() && !preferences.isEmpty());
      }
docs: todo: cleanup this