presto-main/src/main/java/io/prestosql/operator/StreamingAggregationOperator.java/StreamingAggregationOperator/isFinished
class StreamingAggregationOperator:    @Override
    public boolean isFinished()
    {
        return finishing && outputPages.isEmpty() && currentGroup == null && pageBuilder.isEmpty();
    }