@Override
    public WorkProcessor<Page> buildResult()
    {
        if (groupByHash.getGroupCount() == 0) {
            return WorkProcessor.fromIterator(emptyIterator());
        }
        return WorkProcessor.fromIterator(new ResultIterator(IntStream.range(0, groupByHash.getGroupCount()).iterator(), false));
    }
@Test
    public void testEmptyInput()
    {
        InMemoryGroupedTopNBuilder groupedTopNBuilder = new InMemoryGroupedTopNBuilder(
                ImmutableList.of(BIGINT),
                (left, leftPosition, right, rightPosition) -> {
                    throw new UnsupportedOperationException();
                },
                5,
                false,
                new TestingMemoryContext(100L),
                new NoChannelGroupByHash());

        assertFalse(groupedTopNBuilder.buildResult().iterator().hasNext());
    }