void () { VirtualFile file = myFixture.getTempDirFixture().createFile("tempfile.txt"); int fileId = ((VirtualFileWithId)file).getId(); Generator<ID<?, ?>> indexIds = Generator.sampledFrom(FileBasedIndexExtension .EXTENSION_POINT_NAME.getExtensionList().stream() .map(ex -> ex.getName()) .sorted(Comparator.comparing(id -> id.getName())) .collect(Collectors.toList())); Generator<ChangeIndexedStampForIndexOp> changeIndexedStampOps = Generator.sampledFrom((id, indexId) -> IndexingStamp.setFileIndexedStateCurrent(id, indexId, false), (id, indexId) -> IndexingStamp.setFileIndexedStateOutdated(id, indexId), (id, indexId) -> IndexingStamp.setFileIndexedStateUnindexed(id, indexId)); Generator<ChangeIndexedStamp> stampGenerator = Generator.zipWith(indexIds, changeIndexedStampOps, (id, op) -> new ChangeIndexedStamp(op, id)); PropertyChecker.customized().withIterationCount(30).forAll(stampGenerator, stamp -> { stamp.setIndexedStamp(fileId); Set<ID<?, ?>> nonTrivialIndexesBeforeFlush = new HashSet<>(IndexingStamp.getNontrivialFileIndexedStates(fileId)); IndexingStamp.flushCache(fileId); IndexingStamp.flushCaches(); Set<ID<?, ?>> nonTrivialIndexesAfterFlush = new HashSet<>(IndexingStamp.getNontrivialFileIndexedStates(fileId)); boolean equals = nonTrivialIndexesBeforeFlush.equals(nonTrivialIndexesAfterFlush); IndexingStamp.flushCaches(); return equals; }); }