@Test public void delegatesToDelegate() { assertThat(supplier.get()).isEqualTo(DEFAULT_VALUE); verify(delegate).get(); verifyNoMoreInteractions(delegate); }
@Override public T get() { Round present = round; if (present.isFirstToArrive()) { present.execute(); return present.getResult(); } Round next = present.awaitDone(); if (next.isFirstToArrive()) { next.execute(); } return next.getResult(); }
CoalescingSupplier implements Supplier<T> { @Override public T get() { Round present = round; if (present.isFirstToArrive()) { present.execute(); return present.getResult(); } Round next = present.awaitDone(); if (next.isFirstToArrive()) { next.execute(); } return next.getResult(); } }
CoalescingSupplier implements Supplier<T> { @Override public T get() { Round present = round; if (present.isFirstToArrive()) { present.execute(); return present.getResult(); } Round next = present.awaitDone(); if (next.isFirstToArrive()) { next.execute(); } return next.getResult(); } CoalescingSupplier(Supplier<T> delegate); }
CoalescingSupplier implements Supplier<T> { @Override public T get() { Round present = round; if (present.isFirstToArrive()) { present.execute(); return present.getResult(); } Round next = present.awaitDone(); if (next.isFirstToArrive()) { next.execute(); } return next.getResult(); } CoalescingSupplier(Supplier<T> delegate); @Override T get(); ListenableFuture<T> getAsync(); }
CoalescingSupplier implements Supplier<T> { @Override public T get() { Round present = round; if (present.isFirstToArrive()) { present.execute(); return present.getResult(); } Round next = present.awaitDone(); if (next.isFirstToArrive()) { next.execute(); } return next.getResult(); } CoalescingSupplier(Supplier<T> delegate); @Override T get(); ListenableFuture<T> getAsync();  }