@Override
    public Optional<BufferOrEvent> pollNext() throws IOException, InterruptedException {
        return getNextBufferOrEvent(false);
    }
@Test
    void testEmptyPull() throws IOException, InterruptedException {
        final SingleInputGate inputGate1 = createInputGate(1);
        TestInputChannel inputChannel1 = new TestInputChannel(inputGate1, 0, false, true);
        inputGate1.setInputChannels(inputChannel1);

        final SingleInputGate inputGate2 = createInputGate(1);
        TestInputChannel inputChannel2 = new TestInputChannel(inputGate2, 0, false, true);
        inputGate2.setInputChannels(inputChannel2);

        UnionInputGate inputGate = new UnionInputGate(inputGate1, inputGate2);

        inputChannel1.notifyChannelNonEmpty();
        assertThat(inputGate.getAvailableFuture()).isDone();
        assertThat(inputGate.pollNext()).isNotPresent();
        assertThat(inputGate.getAvailableFuture()).isNotDone();
    }