public final List<E> findAll(E key) {
        if (key == null || size() == 0) {
            return Collections.emptyList();
        }
        ArrayList<E> results = new ArrayList<>();
        int slot = slot(elements, key);
        for (int seen = 0; seen < elements.length; seen++) {
            Element element = elements[slot];
            if (element == null) {
                break;
            }
            if (key.elementKeysAreEqual(element)) {
                @SuppressWarnings("unchecked")
                E result = (E) elements[slot];
                results.add(result);
            }
            slot = (slot + 1) % elements.length;
        }
        return results;
    }
@Test
    public void testInsertDelete() {
        ImplicitLinkedHashMultiCollection<TestElement> multiSet = new ImplicitLinkedHashMultiCollection<>(100);
        TestElement e1 = new TestElement(1);
        TestElement e2 = new TestElement(1);
        TestElement e3 = new TestElement(2);
        multiSet.mustAdd(e1);
        multiSet.mustAdd(e2);
        multiSet.mustAdd(e3);
        assertFalse(multiSet.add(e3));
        assertEquals(3, multiSet.size());
        expectExactTraversal(multiSet.findAll(e1).iterator(), e1, e2);
        expectExactTraversal(multiSet.findAll(e3).iterator(), e3);
        multiSet.remove(e2);
        expectExactTraversal(multiSet.findAll(e1).iterator(), e1);
        assertTrue(multiSet.contains(e2));
    }