Here you can find the source of max(Collection
public static Number max(Collection<Number> list)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static Number max(Collection<Number> list) { Number max = list.iterator().next(); for (Number item : list) { if (item.floatValue() > max.floatValue()) { max = item;/*from www.j ava 2 s.co m*/ } } return max; } }