@Override
    public boolean offer(E e) {
        if (size() == capacity) {
            return false;
        }

        return super.offer(e);
    }
@Test
    public void test() {
        int capacity = 16;
        BoundPriorityQueue<Integer> queue = new BoundPriorityQueue<>(capacity);
        for (int k = 0; k < capacity; k++) {
            queue.add(k);
        }

        boolean result = queue.offer(0);
        assertFalse(result);
    }