### Question:
DefaultHostnameVerifier implements HttpClientHostnameVerifier { static void matchDNSName(final String host, final List<SubjectName> subjectAlts, final PublicSuffixMatcher publicSuffixMatcher) throws SSLException { final String normalizedHost = DnsUtils.normalize(host); for (int i = 0; i < subjectAlts.size(); i++) { final SubjectName subjectAlt = subjectAlts.get(i); if (subjectAlt.getType() == SubjectName.DNS) { final String normalizedSubjectAlt = DnsUtils.normalize(subjectAlt.getValue()); if (matchIdentityStrict(normalizedHost, normalizedSubjectAlt, publicSuffixMatcher)) { return; } } } throw new SSLPeerUnverifiedException("Certificate for <" + host + "> doesn't match any " + "of the subject alternative names: " + subjectAlts); } DefaultHostnameVerifier(final PublicSuffixMatcher publicSuffixMatcher);  DefaultHostnameVerifier(); @Override boolean verify(final String host, final SSLSession session); @Override void verify(
            final String host, final X509Certificate cert);  }### Answer:
@Test public void testMatchDNSName() throws Exception { DefaultHostnameVerifier.matchDNSName( "host.domain.com", Collections.singletonList(SubjectName.DNS("*.domain.com")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "host.xx", Collections.singletonList(SubjectName.DNS("*.xx")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "host.appspot.com", Collections.singletonList(SubjectName.DNS("*.appspot.com")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "demo-s3-bucket.s3.eu-central-1.amazonaws.com", Collections.singletonList(SubjectName.DNS("*.s3.eu-central-1.amazonaws.com")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "hostname-workspace-1.local", Collections.singletonList(SubjectName.DNS("hostname-workspace-1.local")), publicSuffixMatcher); }