code: public static X509HostnameVerifier adapt(HostnameVerifier verifier) {
      if (verifier == null) {
        throw new NullPointerException("verifier:null");
      }
  
      if (verifier instanceof X509HostnameVerifier) {
        return (X509HostnameVerifier) verifier;
      }
  
      return new X509HostnameVerifierAdapter(verifier);
    }
docs: Adapts a {@link HostnameVerifier} to be compatible with the HttpClient
  {@link X509HostnameVerifier}.