code: public static <T> List<T> maxList (Iterable<T> iterable, Comparator<? super T> comp)
      {
          Iterator<T> itr = iterable.iterator();
          T max = itr.next();
          List<T> maxes = new ArrayList<T>();
          maxes.add(max);
          if (itr.hasNext()) {
              do {
                  T elem = itr.next();
                  int cmp = comp.compare(max, elem);
                  if (cmp <= 0) {
                      if (cmp < 0) {
                          max = elem;
                          maxes.clear();
                      }
                      maxes.add(elem);
                  }
              } while (itr.hasNext());
  
          } else if (0 != comp.compare(max, max)) {
              // The main point of this test is to compare the sole element to something,
              // in case it turns out to be incompatible with the Comparator for some reason.
              // In that case, we don't even get to this IAE, we've probably already bombed out
              // with an NPE or CCE. For example, the Comparable version could be called with
              // a sole element of null. (Collections.max() gets this wrong.)
              throw new IllegalArgumentException();
          }
          return maxes;
      }
docs: Return a List containing all the elements of the specified Iterable that compare as being
  equal to the maximum element.
  
  @throws NoSuchElementException if the Iterable is empty.