void (@NotNull Project project, @NotNull Consumer<MutableEntityStorage> consumer) { WorkspaceModel workspaceModel = WorkspaceModel.getInstance(project); EntityStorage entityStorage = workspaceModel.getEntityStorage().getCurrent(); MutableEntityStorage preliminaryBuilder = EntityStorageKt.toBuilder(entityStorage.toSnapshot()); consumer.accept(preliminaryBuilder); workspaceModel.updateProjectModel("EntityIndexingServiceTest", storage -> { storage.addDiff(preliminaryBuilder); return Unit.INSTANCE; }); }