### Question:
BallotBox implements Lifecycle<BallotBoxOptions>, Describer { public void clearPendingTasks() { final long stamp = this.stampedLock.writeLock(); try { this.pendingMetaQueue.clear(); this.pendingIndex = 0; this.closureQueue.clear(); } finally { this.stampedLock.unlockWrite(stamp); } }  long getLastCommittedIndex(); @Override boolean init(final BallotBoxOptions opts); boolean commitAt(final long firstLogIndex, final long lastLogIndex, final PeerId peer); void clearPendingTasks(); boolean resetPendingIndex(final long newPendingIndex); boolean appendPendingTask(final Configuration conf, final Configuration oldConf, final Closure done); boolean setLastCommittedIndex(final long lastCommittedIndex); @Override void shutdown(); @Override void describe(final Printer out);  }### Answer:
@Test public void testClearPendingTasks() { testAppendPendingTask(); this.box.clearPendingTasks(); assertTrue(this.box.getPendingMetaQueue().isEmpty()); assertTrue(this.closureQueue.getQueue().isEmpty()); assertEquals(0, closureQueue.getFirstIndex()); }