code: @Override
      public Set<FacetRank> calculate(Collection<Facet> facets) {
          // calculate TF
          Set<FacetRank> facetsRank = facets.stream()
                                            .collect(Collectors.groupingBy(new GroupByFacetType()))
                                            .entrySet()
                                            .stream()
                                            .flatMap(facetTypeEntry -> {
                                                List<Facet> valuesByFacetType = facetTypeEntry.getValue();
                                                int termsByFacetType = valuesByFacetType.size();
  
                                                return valuesByFacetType.stream()
                                                                        .collect(Collectors.groupingBy(new GroupByFacet()))
                                                                        .entrySet()
                                                                        .stream()
                                                                        .flatMap(new CalculateTfFunction(termsByFacetType));
                                            })
                                            .collect(Collectors.toSet());
  
          return facetsRank;
      }
docs: {@inheritDoc}
  
  @param facets