@Test
    public void testLookupFirstLogPosFromLogIndex() {
        this.indexDB.startServiceManager();
        {
            this.indexDB.appendIndexAsync(1, 1, IndexType.IndexSegment);
            this.indexDB.appendIndexAsync(2, 2, IndexType.IndexSegment);
            final Pair<Integer, Long> posPair = this.indexDB.appendIndexAsync(3, 3, IndexType.IndexConf);
            this.indexDB.waitForFlush(posPair.getSecond(), 100);
        }

        final Pair<Integer, Integer> posPair = this.indexDB.lookupFirstLogPosFromLogIndex(1);
        final int firstSegmentPos = posPair.getFirst();
        final int firstConfPos = posPair.getSecond();
        assertEquals(firstSegmentPos, 1);
        assertEquals(firstConfPos, 3);
    }
Test for Service , which enables auto flush
jraft-extension/java-log-storage-impl/src/test/java/com/alipay/sofa/jraft/storage/db/IndexDBTest.java