@Override
    public Map<String, Integer> getIdPositionMap() {
        readLock.lock();
        try {
            // asMap is sorted by key
            var keyObjectMap = getKeyObjectMap();
            int i = 0;
            var idPositionMap = new HashMap<String, Integer>();
            for (var valueIdsEntry : keyObjectMap.entrySet()) {
                var ids = valueIdsEntry.getValue();
                for (String id : ids) {
                    idPositionMap.put(id, i);
                }
                i++;
            }
            return idPositionMap;
        } finally {
            readLock.unlock();
        }
    }
@Test
    void getIdPositionMapTest() {
        var indexView = createCommentIndexView();
        var topIndexEntry = prepareForPositionMapTest(indexView, "spec.top");
        var topIndexEntryFromView = indexView.getIndexEntry("spec.top");
        assertThat(topIndexEntry.getIdPositionMap())
            .isEqualTo(topIndexEntryFromView.getIdPositionMap());

        var creationTimeIndexEntry = prepareForPositionMapTest(indexView, "spec.creationTime");
        var creationTimeIndexEntryFromView = indexView.getIndexEntry("spec.creationTime");
        assertThat(creationTimeIndexEntry.getIdPositionMap())
            .isEqualTo(creationTimeIndexEntryFromView.getIdPositionMap());

        var priorityIndexEntry = prepareForPositionMapTest(indexView, "spec.priority");
        var priorityIndexEntryFromView = indexView.getIndexEntry("spec.priority");
        assertThat(priorityIndexEntry.getIdPositionMap())
            .isEqualTo(priorityIndexEntryFromView.getIdPositionMap());
    }