VotingFuture extends AbstractFuture<T> { void voteNo(final Throwable cause) { synchronized (failures) { failures.add(cause); if (castVote()) { resolveResult(); } } } VotingFuture(final T result, final int requiredVotes);   }
@Test public void testVoteNo() throws Exception { future.voteYes(); final RuntimeException cause = new RuntimeException("fail"); future.voteNo(cause); future.voteYes(); checkException(future, cause); }