@Test public void testMapFutureSync() throws Exception { FutureWithTrigger<Integer> futureWithTrigger = new FutureWithTrigger<>(); int test = 1; Triggerer.triggerValue(test, futureWithTrigger); int result = futureWithTrigger.getFuture().mapFuture(i -> { FutureWithTrigger<Integer> next = new FutureWithTrigger<>(); Triggerer.triggerValue(test + 1, next); return next.getFuture(); }).await(); assertEquals(test + 1, result); }
public Future<T> getFuture(){ return this.future; }
FutureWithTrigger { public Future<T> getFuture(){ return this.future; } }
FutureWithTrigger { public Future<T> getFuture(){ return this.future; } FutureWithTrigger(); }
FutureWithTrigger { public Future<T> getFuture(){ return this.future; } FutureWithTrigger(); Callback<T> getTrigger(); Future<T> getFuture(); }
FutureWithTrigger { public Future<T> getFuture(){ return this.future; } FutureWithTrigger(); Callback<T> getTrigger(); Future<T> getFuture();  }