### Question:
PromiseCombiner { public void finish(Promise<Void> aggregatePromise) { ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); checkInEventLoop(); if (this.aggregatePromise != null) { throw new IllegalStateException("Already finished"); } this.aggregatePromise = aggregatePromise; if (doneCount == expectedCount) { tryPromise(); } } @Deprecated  PromiseCombiner();  PromiseCombiner(EventExecutor executor); @Deprecated void add(Promise promise); @SuppressWarnings({ "unchecked", "rawtypes" }) void add(Future future); @Deprecated void addAll(Promise... promises); @SuppressWarnings({ "unchecked", "rawtypes" }) void addAll(Future... futures); void finish(Promise<Void> aggregatePromise);  }### Answer:
@Test public void testNullArgument() { try { combiner.finish(null); Assert.fail(); } catch (NullPointerException expected) { } combiner.finish(p1); verify(p1).trySuccess(null); }
@Test public void testNullAggregatePromise() { combiner.finish(p1); verify(p1).trySuccess(null); }
@SuppressWarnings("unchecked") @Test(expected = IllegalStateException.class) public void testFinishCalledTwiceThrows() { combiner.finish(p1); combiner.finish(p1); }