No, no Arrays.max or ranger, at least in Java 6.
If you look at the signature and implementation of Collections.max, it pretty much uses parameterized types. In Java, typical arrays are at least problematic, which is why, perhaps, it is therefore not recommended to provide a universal max implementation for arrays in Java and keep the focus on collections (shared).
Edit: as newacct correctly points out, using shared arrays is not necessarily more problematic than using shared collections, so I edited the above text as the original was wrong. However, the main argument of “shared arrays is problematic” is still valid, and collections should be preferred over arrays of reference types.
public static <T> T max(Collection<? extends T> coll, Comparator<? super T> comp) { if (comp==null) return (T)max((Collection<SelfComparable>) (Collection) coll); Iterator<? extends T> i = coll.iterator(); T candidate = i.next(); while (i.hasNext()) { T next = i.next(); if (comp.compare(next, candidate) > 0) candidate = next; } return candidate; }
source share