code: public static <T, U> DictionaryFeatureVectorGenerator<T, U> createFromDataWithThreshold(
        Collection<T> data, FeatureGenerator<T, U> generator, int occurrenceThreshold) {
      CountAccumulator<U> featureOccurrenceCounts = FeatureGenerators.getFeatureCounts(generator, data);
      IndexedList<U> features = new IndexedList<U>();
      features.addAll(featureOccurrenceCounts.getKeysAboveCountThreshold(occurrenceThreshold));
      return new DictionaryFeatureVectorGenerator<T, U>(features, generator, true);
    }
docs: Creates a {@code DictionaryFeatureVectorGenerator} which contains
  all of the features generated from {@code data} that occur more
  than {@code occurrenceThreshold} times.
  
  @param data
  @param generator
  @param occurrenceThreshold
  @return