Here you can find the source of min(T... values)
@SafeVarargs public static <T extends Comparable<? super T>> T min(T... values)
//package com.java2s; //License from project: Apache License public class Main { @SafeVarargs public static <T extends Comparable<? super T>> T min(T... values) { T result = null;/*from www .j ava 2s. c o m*/ if (values != null) { for (T value : values) { if (compare(value, result, true) < 0) { result = value; } } } return result; } public static <T extends Comparable<? super T>> int compare(T c1, T c2) { return compare(c1, c2, false); } public static <T extends Comparable<? super T>> int compare(T c1, T c2, boolean nullGreater) { if (c1 == c2) { return 0; } else if (c1 == null) { return nullGreater ? 1 : -1; } else if (c2 == null) { return nullGreater ? -1 : 1; } return c1.compareTo(c2); } }