code: public static <T> Function<Iterable<T>, T> minFunction(final Ordering<T> ordering) {
      return new Function<Iterable<T>, T>() {
        @Override
        public T apply(Iterable<T> input) {
          return ordering.min(input);
        }
      };
    }
docs: Gets a function which maps any iterable to its minimum according to the supplied {@link
  com.google.common.collect.Ordering}.  If no such minimum exists for an input, it will throw an
  exception as specified in {@link Ordering#min(Iterable)}.