@Test
public void testFireOnceMajoritySuccess() {

    SettableFuture<Boolean> f1 = SettableFuture.create();
    SettableFuture<Boolean> f2 = SettableFuture.create();
    SettableFuture<Boolean> f3 = SettableFuture.create();
    List<ListenableFuture<Boolean>> responses = Lists.newArrayList(f1, f2, f3, Futures.<Boolean> immediateFuture(Boolean.FALSE));
    ListenableFuture<Boolean> collector = majorityResponse(responses, Identity);
    f1.set(Boolean.TRUE);
    assertFalse(collector.isDone());
    f2.set(Boolean.TRUE);
    assertTrue(collector.isDone());
    assertTrue(Futures.getUnchecked(collector));
}