private static <F extends Facet<?>> boolean hasFacetWithRoots(final @NotNull Project project, final @NotNull FacetTypeId<F> id) {
    for (Module module : ModuleManager.getInstance(project).getModules()) {
      Collection<? extends Facet<?>> facets = FacetManager.getInstance(module).getFacetsByType(id);
      Iterator<? extends Facet<?>> iterator = facets.iterator();
      if (iterator.hasNext()) {
        return iterator.next() instanceof FacetRootsProvider;
      }
    }
    return false;
  }
private static <F extends Facet<?>> boolean hasFacetWithRoots(final @NotNull Project project, final @NotNull FacetTypeId<F> id)