Here you can find the source of negate(BigDecimal amount)
public static BigDecimal negate(BigDecimal amount)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static BigDecimal negate(BigDecimal amount) { return !isZeroOrNull(amount) ? amount.negate() : amount; }/*from w w w . jav a 2 s . c o m*/ public static Boolean isZeroOrNull(BigDecimal amount) { return amount == null || BigDecimal.ZERO.compareTo(amount) == 0; } public static int compareTo(Object value1, Object value2) { return new BigDecimal(String.valueOf(value1)).compareTo(new BigDecimal(String.valueOf(value2))); } }