public Set<LongPair> items() {
        Set<LongPair> items = new HashSet<>(this.size);
        forEach((item1, item2) -> items.add(new LongPair(item1, item2)));
        return items;
    }
@Test
    public void testItems() {
        GrowablePriorityLongPairQueue queue = new GrowablePriorityLongPairQueue();

        int n = 100;
        int limit = 10;
        for (int i = 0; i < n; i++) {
            queue.add(i, i);
        }

        Set<LongPair> items = queue.items();
        Set<LongPair> limitItems = queue.items(limit);
        assertEquals(items.size(), n);
        assertEquals(limitItems.size(), limit);

        int totalRemovedItems = queue.removeIf((first, second) -> limitItems.contains((new LongPair(first, second))));
        assertEquals(limitItems.size(), totalRemovedItems);
        assertEquals(queue.size(), n - limit);
    }