Being a JDK 1.4 programmer for probably far too many years, I was never able to learn the correct ways to use some of the latest JDK 1.5+ features.  Thanks to a colleague that I work with, he was able to give me tips on better ways to work with more JDK 1.5 compliant coding standards.

One such area was trying to understand how to check if a value (BigDecimal in this case) is bigger, smaller or equal to another BigDecimal.  In order to do this, you can use the following syntax:

BigDecimal minAmount = new BigDecimal(30)
BigDecimal maxAmount = new BigDecimal(20);
minAmount.compareTo(maxAmount)
1 -> Means minAmount is bigger than maxAmount
> BigDecimal minAmount = new BigDecimal(10)
BigDecimal maxAmount = new BigDecimal(20);
minAmount.compareTo(maxAmount)
-1 -> Means minAmount is smaller than maxAmount
> BigDecimal minAmount = new BigDecimal(20)
BigDecimal maxAmount = new BigDecimal(20);
minAmount.compareTo(maxAmount)
0 -> Means both numbers are equal