LdapURLSet { protected synchronized void populate(final List<LdapURL> ldapUrls) { for (LdapURL url : urls) { final LdapURL match = ldapUrls.stream().filter(u -> u.equals(url)).findFirst().orElse(null); if (match != null && !url.isActive()) { match.deactivate(); } } urls.clear(); urls.addAll(ldapUrls); } LdapURLSet(final ConnectionStrategy strategy, final String ldapUrls); List<LdapURL> getUrls(); boolean hasActiveUrls(); List<LdapURL> getActiveUrls(); boolean hasInactiveUrls(); List<LdapURL> getInactiveUrls(); int size(); @Override String toString();  }
@Test(groups = "conn", dataProvider = "urls") public void populate(final LdapURLSet urlSet, final LdapURL[] expected) throws Exception { Assert.assertTrue(urlSet.hasActiveUrls()); Assert.assertEquals(urlSet.getActiveUrls().size(), expected.length); Assert.assertFalse(urlSet.hasInactiveUrls()); Assert.assertEquals(urlSet.getInactiveUrls().size(), 0); for (int i = 0; i < expected.length; i++) { Assert.assertEquals(urlSet.getActiveUrls().get(i), expected[i]); } }