public boolean add(@Nonnull T toAdd) {
        addInternal(toAdd);
        return toAdd.getInternalIndex() == getHeadElementIndex();
    }
@Test
    void testAdd() {
        HeapPriorityQueue<TestElement> priorityQueue = newPriorityQueue(1);

        final List<TestElement> testElements =
                Arrays.asList(new TestElement(4711L, 42L), new TestElement(815L, 23L));

        testElements.sort(
                (l, r) -> getTestElementPriorityComparator().compare(r.priority, l.priority));

        assertThat(priorityQueue.add(testElements.get(0))).isTrue();
        assertThat(priorityQueue.size()).isEqualTo(1);
        assertThat(priorityQueue.add(testElements.get(1))).isTrue();
        assertThat(priorityQueue.size()).isEqualTo(2);
        assertThat(priorityQueue.poll()).isEqualTo(testElements.get(1));
        assertThat(priorityQueue.size()).isEqualTo(1);
        assertThat(priorityQueue.poll()).isEqualTo(testElements.get(0));
        assertThat(priorityQueue.size()).isZero();
    }