Here you can find the source of compare(BigDecimal decimal, Integer i)
public static Integer compare(BigDecimal decimal, Integer i)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static Integer compare(BigDecimal decimal, Integer i) { if (decimal != null && i != null) { return decimal.compareTo(new BigDecimal(i)); }//w w w . j ava2 s. co m return null; } public static Integer compare(BigDecimal decimal, Double d) { if (decimal != null && d != null) { return decimal.compareTo(new BigDecimal(d)); } return null; } }