public void maybeAppend(long timestamp, long offset) {
        maybeAppend(timestamp, offset, false);
    }
@Test
    public void testAppend() {
        appendEntries(maxEntries - 1);
        assertThrows(IllegalArgumentException.class, () -> idx.maybeAppend(10000L, 1000L));
        assertThrows(InvalidOffsetException.class, () -> idx.maybeAppend(10000L, (maxEntries - 2) * 10, true));
        idx.maybeAppend(10000L, 1000L, true);
    }