@Override
  @NotNull
  public <F extends Facet<?>> Collection<F> getFacetsByType(FacetTypeId<F> typeId) {
    if (myType2Facets == null) {
      MultiMap<FacetTypeId<?>, Facet<?>> typeToFacets = new MultiMap<>();
      for (Facet<?> facet : getAllFacets()) {
        typeToFacets.putValue(facet.getTypeId(), facet);
      }
      myType2Facets = typeToFacets.freezeValues();
    }

    @SuppressWarnings("unchecked")
    Collection<F> facets = (Collection<F>)myType2Facets.get(typeId);
    return facets != null ? facets : Collections.emptyList();
  }
@Override
  @NotNull
  public <F extends Facet<?>> Collection<F> getFacetsByType(FacetTypeId<F> typeId)