@Test public void testConsumeAsync() throws Exception { FutureWithTrigger<AtomicBoolean> futureWithTrigger = new FutureWithTrigger<>(); futureWithTrigger.getFuture().consume(b->b.set(true)); AtomicBoolean test = new AtomicBoolean(false); Triggerer.triggerValueAsync(10, test, futureWithTrigger); AtomicBoolean result = futureWithTrigger.getFuture().consume(b->b.set(true)).await(); assertEquals(test, result); assertTrue(test.get()); }
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();  }