Here you can find the source of findMax(Collection
public static double findMax(Collection<Double> vals)
//package com.java2s; import java.util.*; public class Main { public static double findMax(Collection<Double> vals) { double max = Double.MIN_VALUE; for (double d : vals) { if (d > max) max = d;//from w w w .j a va 2s. c o m } return max; } }