### Question:
HttpRedirectPolicyUtils { public static boolean shouldFollowRedirect(HttpRedirectPolicy redirectPolicy, URL currentURL, URL redirectURL) { return POLICY_CHECKERS.get(redirectPolicy).compare(currentURL, redirectURL) == 0; } private  HttpRedirectPolicyUtils(); static boolean shouldFollowRedirect(HttpRedirectPolicy redirectPolicy, URL currentURL, URL redirectURL);  }### Answer:
@Test public void testSameDomainWithSameHostnameAndPort() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("https: assertTrue(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testSameDomainWithDifferentHosts() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("http: assertFalse(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testPeerDomain() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("https: assertTrue(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testPeerDomainSameHostnameAndPort() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("http: assertTrue(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testPeerDomainSameHostname() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("https: assertTrue(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testPeerDomainNegative() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("https: assertFalse(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testSubDomain() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("https: assertTrue(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testSubDomainSameHostnameAndPort() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("http: assertTrue(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testSubDomainSameHostname() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("https: assertTrue(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testSubSubDomain() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("https: assertTrue(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testSubDomainNegative() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("https: assertFalse(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }
@Test public void testAlways() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("https: assertTrue(shouldFollowRedirect(ALWAYS, currentURL, redirectURL)); }
@Test public void testNever() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("http: assertFalse(shouldFollowRedirect(NEVER, currentURL, redirectURL)); }
@Test public void testSameOrigin() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("http: assertTrue(shouldFollowRedirect(ORIGIN, currentURL, redirectURL)); }
@Test public void testSameOriginWithDifferentPorts() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("http: assertFalse(shouldFollowRedirect(ORIGIN, currentURL, redirectURL)); }
@Test public void testSameOriginWithDifferentHost() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("http: assertFalse(shouldFollowRedirect(ORIGIN, currentURL, redirectURL)); }
@Test public void testSameDomain() throws Exception { URL currentURL = new URL("http: URL redirectURL = new URL("http: assertTrue(shouldFollowRedirect(DOMAIN, currentURL, redirectURL)); }