### Question:
ArbitraryOutputBuffer implements OutputBuffer { @Override public ListenableFuture<BufferResult> get(OutputBufferId bufferId, long startingSequenceId, DataSize maxSize) { checkState(!Thread.holdsLock(this), "Cannot get pages while holding a lock on this"); requireNonNull(bufferId, "bufferId is null"); checkArgument(maxSize.toBytes() > 0, "maxSize must be at least 1 byte"); return getBuffer(bufferId).getPages(startingSequenceId, maxSize, Optional.of(masterBuffer)); } ArbitraryOutputBuffer(
            String taskInstanceId,
            StateMachine<BufferState> state,
            DataSize maxBufferSize,
            Supplier<LocalMemoryContext> systemMemoryContextSupplier,
            Executor notificationExecutor); @Override void addStateChangeListener(StateChangeListener<BufferState> stateChangeListener); @Override boolean isFinished(); @Override double getUtilization(); @Override boolean isOverutilized(); @Override OutputBufferInfo getInfo(); @Override void setOutputBuffers(OutputBuffers newOutputBuffers); @Override ListenableFuture<?> isFull(); @Override void enqueue(List<SerializedPage> pages); @Override void enqueue(int partition, List<SerializedPage> pages); @Override ListenableFuture<BufferResult> get(OutputBufferId bufferId, long startingSequenceId, DataSize maxSize); @Override void acknowledge(OutputBufferId bufferId, long sequenceId); @Override void abort(OutputBufferId bufferId); @Override void setNoMorePages(); @Override void destroy(); @Override void fail(); @Override long getPeakMemoryUsage();  }### Answer:
@Test public void testDuplicateRequests() { ArbitraryOutputBuffer buffer = createArbitraryBuffer( createInitialEmptyOutputBuffers(ARBITRARY) .withBuffer(FIRST, BROADCAST_PARTITION_ID) .withNoMoreBufferIds(), sizeOfPages(10)); for (int i = 0; i < 3; i++) { addPage(buffer, createPage(i)); } assertQueueState(buffer, 3, FIRST, 0, 0); assertBufferResultEquals(TYPES, getBufferResult(buffer, FIRST, 0, sizeOfPages(10), NO_WAIT), bufferResult(0, createPage(0), createPage(1), createPage(2))); assertQueueState(buffer, 0, FIRST, 3, 0); assertBufferResultEquals(TYPES, getBufferResult(buffer, FIRST, 0, sizeOfPages(10), NO_WAIT), bufferResult(0, createPage(0), createPage(1), createPage(2))); assertQueueState(buffer, 0, FIRST, 3, 0); buffer.get(FIRST, 3, sizeOfPages(10)).cancel(true); assertBufferResultEquals(TYPES, getBufferResult(buffer, FIRST, 0, sizeOfPages(10), NO_WAIT), emptyResults(TASK_INSTANCE_ID, 0, false)); assertQueueState(buffer, 0, FIRST, 0, 3); }