public IndexEntry lookupIndex(final long logIndex) {
        mapInIfNecessary();
        this.readLock.lock();
        try {
            final ByteBuffer byteBuffer = sliceByteBuffer();
            final int slot = (int) (logIndex - this.header.getFirstLogIndex());
            if (slot < 0) {
                return IndexEntry.newInstance();
            } else {
                return parseEntry(byteBuffer, slot);
            }
        } finally {
            this.readLock.unlock();
        }
    }
@Test
    public void testLooUp() {
        testAppendIndex();

        final IndexEntry entry0 = this.offsetIndex.lookupIndex(appendEntry0.getOffset());
        assertEquals(appendEntry0.getOffset(), entry0.getOffset());

        final IndexEntry entry1 = this.offsetIndex.lookupIndex(appendEntry1.getOffset());
        assertEquals(appendEntry1.getOffset(), entry1.getOffset());

        final IndexEntry entry2 = this.offsetIndex.lookupIndex(appendEntry2.getOffset());
        assertEquals(appendEntry2.getOffset(), entry2.getOffset());
    }