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();
        }
    }
@Test
    public void testNullArgument() {
        try {
            combiner.finish(null);
            fail();
        } catch (NullPointerException expected) {
            // expected
        }
        combiner.finish(p1);
        verify(p1).trySuccess(null);
    }