public JRTConnectionPool updateSources(List<String> addresses) {
        ConfigSourceSet newSources = new ConfigSourceSet(addresses);
        return updateSources(newSources);
    }
@Test
    public void updateSources() {
        ConfigSourceSet twoSources = new ConfigSourceSet(List.of("host0", "host1"));
        JRTConnectionPool sourcePool = new JRTConnectionPool(twoSources);

        ConfigSourceSet sourcesBefore = sourcePool.getSourceSet();

        // Update to the same set, should be equal
        sourcePool.updateSources(twoSources);
        assertEquals(sourcePool.getSourceSet(), sourcesBefore);

        // Update to new set
        List<String> newSources = new ArrayList<>();
        newSources.add("host2");
        newSources.add("host3");
        sourcePool.updateSources(newSources);
        ConfigSourceSet newSourceSet = sourcePool.getSourceSet();
        assertNotNull(newSourceSet);
        assertEquals(2, newSourceSet.getSources().size());
        assertNotEquals(sourcesBefore, newSourceSet);
        assertTrue(newSourceSet.getSources().contains("host2"));
        assertTrue(newSourceSet.getSources().contains("host3"));

        // Update to new set with just one host
        List<String> newSources2 = new ArrayList<>();
        newSources2.add("host4");
        sourcePool.updateSources(newSources2);
        ConfigSourceSet newSourceSet2 = sourcePool.getSourceSet();
        assertNotNull(newSourceSet2);
        assertEquals(1, newSourceSet2.getSources().size());
        assertNotEquals(newSourceSet, newSourceSet2);
        assertTrue(newSourceSet2.getSources().contains("host4"));

        sourcePool.close();
    }