public void refresh(List<Pair<T>> itemsWithWeight) {
        Ref<T> newRef = new Ref<>(itemsWithWeight);
        newRef.refresh();
        newRef.poller = this.ref.poller.refresh(newRef.items);
        this.ref = newRef;
    }
@Test
    void testRefresh() {
        Chooser<String, String> chooser = new Chooser<>("test");
        assertEquals("test", chooser.getUniqueKey());
        assertNull(chooser.random());
        List<Pair<String>> list = new LinkedList<>();
        list.add(new Pair<>("test", 1));
        chooser.refresh(list);
        String actual = chooser.random();
        assertNotNull(actual);
        assertEquals("test", actual);
    }