### Question:
BroadcastOutputBuffer implements OutputBuffer { @Override public void abort(OutputBufferId bufferId) { checkState(!Thread.holdsLock(this), "Cannot abort while holding a lock on this"); requireNonNull(bufferId, "bufferId is null"); getBuffer(bufferId).destroy(); checkFlushComplete(); } BroadcastOutputBuffer(
            String taskInstanceId,
            StateMachine<BufferState> state,
            DataSize maxBufferSize,
            Supplier<LocalMemoryContext> systemMemoryContextSupplier,
            Executor notificationExecutor,
            Runnable notifyStatusChanged); @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 partitionNumber, List<SerializedPage> pages); @Override ListenableFuture<BufferResult> get(OutputBufferId outputBufferId, 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 testAbort() { BroadcastOutputBuffer bufferedBuffer = createBroadcastBuffer( createInitialEmptyOutputBuffers(BROADCAST) .withBuffer(FIRST, BROADCAST_PARTITION_ID) .withBuffer(SECOND, BROADCAST_PARTITION_ID) .withNoMoreBufferIds(), sizeOfPages(10)); for (int i = 0; i < 10; i++) { addPage(bufferedBuffer, createPage(i)); } bufferedBuffer.setNoMorePages(); assertBufferResultEquals(TYPES, getBufferResult(bufferedBuffer, FIRST, 0, sizeOfPages(1), NO_WAIT), bufferResult(0, createPage(0))); bufferedBuffer.abort(FIRST); assertQueueClosed(bufferedBuffer, FIRST, 0); assertBufferResultEquals(TYPES, getBufferResult(bufferedBuffer, FIRST, 1, sizeOfPages(1), NO_WAIT), emptyResults(TASK_INSTANCE_ID, 0, true)); assertBufferResultEquals(TYPES, getBufferResult(bufferedBuffer, SECOND, 0, sizeOfPages(1), NO_WAIT), bufferResult(0, createPage(0))); bufferedBuffer.abort(SECOND); assertQueueClosed(bufferedBuffer, SECOND, 0); assertFinished(bufferedBuffer); assertBufferResultEquals(TYPES, getBufferResult(bufferedBuffer, SECOND, 1, sizeOfPages(1), NO_WAIT), emptyResults(TASK_INSTANCE_ID, 0, true)); }