code: public <E extends T> List<E> leastOf(Iterator<E> iterator, int k) {
      checkNotNull(iterator);
      checkNonnegative(k, "k");
  
      if (k == 0 || !iterator.hasNext()) {
        return ImmutableList.of();
      } else if (k >= Integer.MAX_VALUE / 2) {
        // k is really large; just do a straightforward sorted-copy-and-sublist
        ArrayList<E> list = Lists.newArrayList(iterator);
        Collections.sort(list, this);
        if (list.size() > k) {
          list.subList(k, list.size()).clear();
        }
        list.trimToSize();
        return Collections.unmodifiableList(list);
      } else {
        TopKSelector<E> selector = TopKSelector.least(k, this);
        selector.offerAll(iterator);
        return selector.topK();
      }
    }
docs: Returns the {@code k} least elements from the given iterator according to this ordering, in
  order from least to greatest. If there are fewer than {@code k} elements present, all will be
  included.
  
  <p>The implementation does not necessarily use a <i>stable</i> sorting algorithm; when multiple
  elements are equivalent, it is undefined which will come first.
  
  <p><b>Java 8 users:</b> Continue to use this method for now. After the next release of Guava,
  use {@code Streams.stream(iterator).collect(Comparators.least(k, thisComparator))} instead.
  
  @return an immutable {@code RandomAccess} list of the {@code k} least elements in ascending
  order
  @throws IllegalArgumentException if {@code k} is negative
  @since 14.0