@Nullable
  private static Facet<?> findFacet(final @NotNull Project project, final @NotNull VirtualFile file) {
    for (FacetTypeId<?> id : FacetTypeRegistry.getInstance().getFacetTypeIds()) {
      if (hasFacetWithRoots(project, id)) {
        Facet<?> facet = FacetFinder.getInstance(project).findFacet(file, (FacetTypeId)id);
        if (facet != null) {
          return facet;
        }
      }
    }
    return null;
  }
@Nullable
  private static Facet<?> findFacet(final @NotNull Project project, final @NotNull VirtualFile file)