@Test public void testNullAggregatePromise() { combiner.finish(p1); verify(p1).trySuccess(any(Void.class)); }
public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }
PromiseCombiner { public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } } }
PromiseCombiner { public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }  }
PromiseCombiner { public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }  @SuppressWarnings({ "unchecked", "rawtypes" }) void add(Promise promise); @SuppressWarnings({ "unchecked", "rawtypes" }) void addAll(Promise... promises); void finish(Promise<Void> aggregatePromise); }
PromiseCombiner { public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }  @SuppressWarnings({ "unchecked", "rawtypes" }) void add(Promise promise); @SuppressWarnings({ "unchecked", "rawtypes" }) void addAll(Promise... promises); void finish(Promise<Void> aggregatePromise);  }