public static boolean isSameValueTreatNullAsZero(final BigDecimal val1, final BigDecimal val2) {
        return val1 == null && val2 == null || signum(val1) == 0 && signum(val2) == 0 || val1 != null && val2 != null && val1.compareTo(val2) == 0;
    }
public static boolean isSameValueTreatNullAsZero ( final BigDecimal val1 , final BigDecimal val2 ) { return val1 == null && val2 == null || signum ( val1 ) == 0 && signum ( val2 ) == 0 || val1 != null && val2 != null && val1 . compareTo ( val2 ) == 0 ; }
@param val1 the nullable BigDecimal
@param val2 the nullable BigDecimal
@return true if val1 == val2 (ignoring scale and null are treated as 0)