private OffsetPosition lastEntry() {
        lock.lock();
        try {
            int entries = entries();
            if (entries == 0)
                return new OffsetPosition(baseOffset(), 0);
            else
                return parseEntry(mmap(), entries - 1);
        } finally {
            lock.unlock();
        }
    }
The last entry in the index
storage/src/main/java/org/apache/kafka/storage/internals/log/OffsetIndex.java