@Override
    public <E extends Extension> void indexRecord(E extension) {
        writeLock.lock();
        var transaction = new IndexerTransactionImpl();
        try {
            transaction.begin();
            doIndexRecord(extension).forEach(transaction::add);
            transaction.commit();
        } catch (Throwable e) {
            transaction.rollback();
            throw e;
        } finally {
            writeLock.unlock();
        }
    }
@Test
    void indexRecord() {
        var nameIndex = getNameIndexSpec();
        var indexContainer = new IndexEntryContainer();
        var descriptor = new IndexDescriptor(nameIndex);
        descriptor.setReady(true);
        indexContainer.add(new IndexEntryImpl(descriptor));

        var indexer = new DefaultIndexer(List.of(descriptor), indexContainer);
        indexer.indexRecord(createFakeExtension());

        var iterator = indexer.allIndexesIterator();
        assertThat(iterator.hasNext()).isTrue();
        var indexEntry = iterator.next();
        var entries = indexEntry.entries();
        assertThat(entries).hasSize(1);
        assertThat(entries).contains(Map.entry("fake-extension", "fake-extension"));
    }