code: public static <E> Set<E> retainBelow(Counter<E> counter, double countMaxThreshold) {
      Set<E> removed = new HashSet<E>();
      for (E key : counter.keySet()) {
        if (counter.getCount(key) > countMaxThreshold) {
          removed.add(key);
        }
      }
      for (E key : removed) {
        counter.remove(key);
      }
      return removed;
    }
docs: Removes all entries with counts above the given threshold, returning the
  set of removed entries.
  
  @param counter
  The counter.
  @param countMaxThreshold
  The maximum count for an entry to be kept. Entries (strictly) more
  than this threshold are discarded.
  @return The set of discarded entries.