Here you can find the source of equals(BigDecimal a, BigDecimal b)
public static boolean equals(BigDecimal a, BigDecimal b)
//package com.java2s; import java.math.BigDecimal; public class Main { public static boolean equals(BigDecimal a, BigDecimal b) { return (a == b) || (a != null && a.compareTo(b) == 0); }//from ww w . ja va 2s. c om }