Code example for BigDecimal

Methods: compareTo

0
    if (expectedResult == null || receivedResult == null)
    { 
      throw new AssertionFailedError("Assertation failed: Expected " + expectedResult + ", but got " + receivedResult);
    } 
 
    if (expectedResult.compareTo(receivedResult) != 0)
    { 
      throw new AssertionFailedError("Assertation failed: Expected " + expectedResult + ", but got " + receivedResult);
    } 
  } 
} 
Experience pair programming with AI  Get Codota for Java