void () { final Int2ObjectMap<String> fileIdToName = generateFileNames(ENOUGH_ENTRIES_TO_CHECK); final Map<String, IntArraySet> etalon = CollectionFactory.createSmallMemoryFootprintMap(); for (Int2ObjectMap.Entry<String> e : fileIdToName.int2ObjectEntrySet()) { final int fileId = e.getIntKey(); final String fileName = e.getValue(); index.addFileName(fileId, fileName); etalon.computeIfAbsent(fileName, _name -> new IntArraySet()) .add(fileId); } for (String fileName : new HashSet<>(fileIdToName.values())) { final IntArraySet trueFileIds = etalon.get(fileName); final IntArraySet fileIdsFromIndex = lookupIndexByFileName(index, fileName); assertTrue( "index _must_ return all 'true' fileIds (+maybe few 'false' ones)", fileIdsFromIndex.containsAll(trueFileIds) ); } }