code: public static <T extends Comparable<T>> T maxOr(Collection<T> values, T defaultVal) {
      if (values.isEmpty()) {
        return defaultVal;
      } else {
        return Collections.max(values);
      }
    }
docs: Like {@link Collections#max(java.util.Collection)} except with a default value returned in the
  case of an empty collection.