public synchronized boolean remove(long item1, long item2) {
        boolean removed = false;

        int index = 0;
        for (int i = 0; i < this.size; i++) {
            if (data[index] == item1 && data[index + 1] == item2) {
                removeAtWithoutLock(index);
                removed = true;
            }
            index = index + 2;
        }

        return removed;
    }
@Test
    public void testRemove() {
        GrowablePriorityLongPairQueue queue = new GrowablePriorityLongPairQueue();

        assertTrue(queue.isEmpty());
        queue.add(1, 1);
        assertFalse(queue.isEmpty());

        assertFalse(queue.remove(1, 0));
        assertFalse(queue.isEmpty());
        assertTrue(queue.remove(1, 1));
        assertTrue(queue.isEmpty());
    }