public void append(AbortedTxn abortedTxn) throws IOException {
        lastOffset.ifPresent(offset -> {
            if (offset >= abortedTxn.lastOffset())
                throw new IllegalArgumentException("The last offset of appended transactions must increase sequentially, but "
                    + abortedTxn.lastOffset() + " is not greater than current last offset " + offset + " of index "
                    + file.getAbsolutePath());
        });
        lastOffset = OptionalLong.of(abortedTxn.lastOffset());
        Utils.writeFully(channel(), abortedTxn.buffer.duplicate());
    }
@Test
    public void testLastOffsetMustIncrease() throws IOException {
        index.append(new AbortedTxn(1L, 5, 15, 13));
        assertThrows(IllegalArgumentException.class, () -> index.append(new AbortedTxn(0L, 0,
                15, 11)));
    }