public OffsetPosition entry(int n) {
        return maybeLock(lock, () -> {
            if (n >= entries())
                throw new IllegalArgumentException("Attempt to fetch the " + n + "th entry from index " +
                    file().getAbsolutePath() + ", which has size " + entries());
            return parseEntry(mmap(), n);
        });
    }
@Test
    public void testEntry() {
        for (int i = 0; i < index.maxEntries(); ++i) {
            index.append(index.baseOffset() + i, i);
        }
        for (int i = 0; i < index.maxEntries(); ++i) {
            assertEquals(new OffsetPosition(index.baseOffset() + i, i), index.entry(i));
        }
    }