### Question:
BallotBox implements Lifecycle<BallotBoxOptions>, Describer { public boolean resetPendingIndex(final long newPendingIndex) { final long stamp = this.stampedLock.writeLock(); try { if (!(this.pendingIndex == 0 && this.pendingMetaQueue.isEmpty())) { LOG.error("resetPendingIndex fail, pendingIndex={}, pendingMetaQueueSize={}.", this.pendingIndex, this.pendingMetaQueue.size()); return false; } if (newPendingIndex <= this.lastCommittedIndex) { LOG.error("resetPendingIndex fail, newPendingIndex={}, lastCommittedIndex={}.", newPendingIndex, this.lastCommittedIndex); return false; } this.pendingIndex = newPendingIndex; this.closureQueue.resetFirstIndex(newPendingIndex); return true; } 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 testResetPendingIndex() { assertEquals(0, closureQueue.getFirstIndex()); assertEquals(0, box.getPendingIndex()); assertTrue(box.resetPendingIndex(1)); assertEquals(1, closureQueue.getFirstIndex()); assertEquals(1, box.getPendingIndex()); }