public void clearPendingTasks() {
        final long stamp = this.stampedLock.writeLock();
        try {
            this.pendingMetaQueue.clear();
            this.pendingIndex = 0;
            this.closureQueue.clear();
        } finally {
            this.stampedLock.unlockWrite(stamp);
        }
    }
@Test
    public void testClearPendingTasks() {
        testAppendPendingTask();
        this.box.clearPendingTasks();
        assertTrue(this.box.getPendingMetaQueue().isEmpty());
        assertTrue(this.closureQueue.getQueue().isEmpty());
        assertEquals(0, closureQueue.getFirstIndex());
    }