### Question:
TopNOperator implements AdapterWorkProcessorOperator { @Override public boolean needsInput() { return pageBuffer.isEmpty() && !pageBuffer.isFinished(); } private  TopNOperator(
            MemoryTrackingContext memoryTrackingContext,
            Optional<WorkProcessor<Page>> sourcePages,
            List<Type> types,
            int n,
            List<Integer> sortChannels,
            List<SortOrder> sortOrders,
            TypeOperators typeOperators); static OperatorFactory createOperatorFactory(
            int operatorId,
            PlanNodeId planNodeId,
            List<? extends Type> types,
            int n,
            List<Integer> sortChannels,
            List<SortOrder> sortOrders,
            TypeOperators typeOperators); @Override WorkProcessor<Page> getOutputPages(); @Override boolean needsInput(); @Override void addInput(Page page); @Override void finish();  }### Answer:
@Test public void testLimitZero() throws Exception { OperatorFactory factory = topNOperatorFactory( ImmutableList.of(BIGINT), 0, ImmutableList.of(0), ImmutableList.of(DESC_NULLS_LAST)); try (Operator operator = factory.createOperator(driverContext)) { assertNull(operator.getOutput()); assertTrue(operator.isFinished()); assertFalse(operator.needsInput()); assertNull(operator.getOutput()); } }