public WeightedItem<T> addOrVote(T item) {
        for (int i = 0; i < list.size(); i++) {
            WeightedItem<T> weightedItem = list.get(i);
            if (weightedItem.item.equals(item)) {
                voteFor(weightedItem);
                return weightedItem;
            }
        }
        return organizeAndAdd(item);
    }
@Test
    public void testListReorganizesAfterMaxSize() {
        WeightedEvictableList<String> list = new WeightedEvictableList<>(3, 100);
        list.addOrVote("c");
        list.addOrVote("b");
        list.addOrVote("b");
        list.addOrVote("a");
        list.addOrVote("a");
        list.addOrVote("a");
        list.addOrVote("d");
        assertItemsInOrder(list, "a", "d");
        // weights are reset after max-size is reached and list is re-organized
        // new item is retained, and it gets a vote
        assertWeightsInOrder(list, 0, 1);
    }