Here you can find the source of getMax(List
public static Integer getMax(List<Integer> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static Integer getMax(List<Integer> list) { if (list == null) { throw new IllegalArgumentException("Empty list not allowed"); }/* w w w. j a v a 2 s. c om*/ Integer max = Integer.MAX_VALUE; for (Integer number : list) { max = Math.max(number, max); } return max; } }