Here you can find the source of max(BigDecimal... amounts)
public static BigDecimal max(BigDecimal... amounts)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static BigDecimal max(BigDecimal... amounts) { BigDecimal result = null; for (BigDecimal bigDecimal : amounts) { if (bigDecimal != null) { result = result == null ? bigDecimal : result.max(bigDecimal); }/*w w w.j a v a 2s .c o m*/ } return result; } }