private static Stream<Class<? extends WorkspaceEntity>> getEntityClassesToCauseReindexing(WorkspaceFileIndexContributor<?> contributor) {
    List<? extends DependencyDescription<?>> dependencies = contributor.getDependenciesOnOtherEntities();
    Stream<Class<? extends WorkspaceEntity>> baseStream = Stream.of(contributor.getEntityClass());
    if (dependencies.isEmpty()) return baseStream;
    Stream<? extends Class<? extends WorkspaceEntity>> dependenciesStream =
      dependencies.stream().filter(description -> description instanceof DependencyDescription.OnParent)
        .map(description -> ((DependencyDescription.OnParent<?, ?>)description).getParentClass());
    return Stream.concat(baseStream, dependenciesStream);
  }
private static Stream<Class<? extends WorkspaceEntity>> getEntityClassesToCauseReindexing(WorkspaceFileIndexContributor<?> contributor)