public OffsetPosition lookup(long targetOffset) {
        return maybeLock(lock, () -> {
            ByteBuffer idx = mmap().duplicate();
            int slot = largestLowerBoundSlotFor(idx, targetOffset, IndexSearchType.KEY);
            if (slot == -1)
                return new OffsetPosition(baseOffset(), 0);
            else
                return parseEntry(idx, slot);
        });
    }
@Test
    public void forceUnmapTest() throws IOException {
        OffsetIndex idx = new OffsetIndex(nonExistentTempFile(), 0L, 10 * 8);
        idx.forceUnmap();
        // mmap should be null after unmap causing lookup to throw a NPE
        assertThrows(NullPointerException.class, () -> idx.lookup(1));
        assertThrows(NullPointerException.class, idx::close);
    }