@Override
    public boolean resize(int newSize) throws IOException {
        lock.lock();
        try {
            if (super.resize(newSize)) {
                this.lastEntry = lastEntryFromIndexFile();
                return true;
            } else
                return false;
        } finally {
            lock.unlock();
        }
    }
@Test
    public void testResize() throws IOException {
        boolean result = idx.resize(maxEntries * idx.entrySize());
        assertFalse(result);

        result = idx.resize(maxEntries / 2 * idx.entrySize());
        assertTrue(result);

        result = idx.resize(maxEntries * 2 * idx.entrySize());
        assertTrue(result);
    }