### Question:
PacBasedProxyProvider implements ProxyProvider { @Override public List<Proxy> select(final URI uri) { Assert.requireNonNull(uri, "uri"); final String proxiesString = pacEvaluator.getProxies(uri); final List<Proxy> proxies = PacUtils.getProxiesFromPacResult(proxiesString); LOG.debug("PAC Proxies found for '{}' : {}", uri, proxies); return Collections.unmodifiableList(proxies); } PacBasedProxyProvider(final URL pacConfigFileUrl, final PacProxyCache cache); @Override List<Proxy> select(final URI uri);  }### Answer:
@Test void selectTest() throws Exception { final URL pacUrl = PacBasedProxyProviderTest.class.getResource("simple-pac.js"); final URI uri = new URI("http: final PacBasedProxyProvider pacBasedProxyProvider = new PacBasedProxyProvider(pacUrl, new NoopPacProxyCache()); final List<Proxy> proxies = pacBasedProxyProvider.select(uri); Assertions.assertNotNull(proxies); Assertions.assertEquals(2, proxies.size()); Assertions.assertEquals(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxy.example.com", 8080)), proxies.get(0)); Assertions.assertEquals(Proxy.NO_PROXY, proxies.get(1)); }
@Test void selectTest2() throws Exception { final URL pacUrl = PacBasedProxyProviderTest.class.getResource("simple-pac.js"); final URI uri = new URI("http: final PacBasedProxyProvider pacBasedProxyProvider = new PacBasedProxyProvider(pacUrl, new NoopPacProxyCache()); final List<Proxy> proxies = pacBasedProxyProvider.select(uri); Assertions.assertNotNull(proxies); Assertions.assertEquals(1, proxies.size()); Assertions.assertEquals(Proxy.NO_PROXY, proxies.get(0)); }
@Test void selectTest3() throws Exception { final URL pacUrl = PacBasedProxyProviderTest.class.getResource("simple-pac.js"); final URI uri = new URI("http: final PacBasedProxyProvider pacBasedProxyProvider = new PacBasedProxyProvider(pacUrl, new NoopPacProxyCache()); final List<Proxy> proxies = pacBasedProxyProvider.select(uri); Assertions.assertNotNull(proxies); Assertions.assertEquals(1, proxies.size()); Assertions.assertEquals(Proxy.NO_PROXY, proxies.get(0)); }