private static <E extends WorkspaceEntity> void collectIEPIteratorsOnChange(@NotNull Change change,
                                                                              @Nullable E oldEntity,
                                                                              @Nullable E newEntity,
                                                                              @NotNull Project project,
                                                                              @NotNull Collection<? super IndexableIteratorBuilder> builders,
                                                                              @NotNull Class<? super E> entityClass) {
    LOG.assertTrue(newEntity != null || change == Change.Removed, "New entity " + newEntity + ", change " + change);
    LOG.assertTrue(oldEntity != null || change == Change.Added, "Old entity " + oldEntity + ", change " + change);

    for (IndexableEntityProvider<?> uncheckedProvider : IndexableEntityProvider.EP_NAME.getExtensionList()) {
      if (entityClass == uncheckedProvider.getEntityClass() && uncheckedProvider instanceof IndexableEntityProvider.Enforced<?>) {
        //noinspection unchecked
        IndexableEntityProvider<E> provider = (IndexableEntityProvider<E>)uncheckedProvider;
        Collection<? extends IndexableIteratorBuilder> generated = switch (change) {
          case Added -> provider.getAddedEntityIteratorBuilders(newEntity, project);
          case Replaced -> provider.getReplacedEntityIteratorBuilders(oldEntity, newEntity, project);
          case Removed -> provider.getRemovedEntityIteratorBuilders(oldEntity, project);
        };
        builders.addAll(generated);
      }

      if (change == Change.Replaced && uncheckedProvider instanceof IndexableEntityProvider.Enforced<?>) {
        for (IndexableEntityProvider.DependencyOnParent<? extends WorkspaceEntity> dependency : uncheckedProvider.getDependencies()) {
          if (entityClass == dependency.getParentClass()) {
            //noinspection unchecked
            builders.addAll(((IndexableEntityProvider.DependencyOnParent<E>)dependency).
                              getReplacedEntityIteratorBuilders(oldEntity, newEntity));
          }
        }
      }
    }
  }
private static <E extends WorkspaceEntity> void collectIEPIteratorsOnChange(@NotNull Change change,
                                                                              @Nullable E oldEntity,
                                                                              @Nullable E newEntity,
                                                                              @NotNull Project project,
                                                                              @NotNull Collection<? super IndexableIteratorBuilder> builders,
                                                                              @NotNull Class<? super E> entityClass)