@Override
    public void abort(OutputBufferId bufferId)
    {
        checkArgument(bufferId.getId() == outputBufferId.getId(), "Invalid bufferId");
        destroy();
    }
@Test
    public void testAbort()
    {
        SpoolingOutputBuffer buffer = createSpoolingOutputBuffer();

        // add three pages into a file
        for (int i = 0; i < 3; i++) {
            addPage(buffer, createPage(i));
        }

        // add two page in memory
        for (int i = 3; i < 5; i++) {
            addPage(buffer, createPage(i));
        }

        try {
            buffer.abort(INVALID_BUFFER_ID);
        }
        catch (IllegalArgumentException e) {
            assertEquals(e.getMessage(), "Invalid bufferId");
        }
        compareTotalBuffered(buffer, 5);

        buffer.abort(BUFFER_ID);
        compareTotalBuffered(buffer, 0);
    }