### Question:
BigDecimalUtils { public static BigDecimal convertNullToZero(final Object value) { if (value == null) { return BigDecimal.ZERO; } if (value instanceof BigDecimal) { return (BigDecimal) value; } return BigDecimal.valueOf(Double.valueOf(value.toString())); } private  BigDecimalUtils(); static BigDecimal convertNullToZero(final Object value); static BigDecimal convertNullToOne(final Object value); static BigDecimal toPercent(final BigDecimal decimalValue, final MathContext mathContext); static boolean valueEquals(final BigDecimal d1, final BigDecimal d2); static Either<Exception, Optional<BigDecimal>> tryParse(final String maybeStringWithDecimal, final Locale locale); static Either<Exception, Optional<BigDecimal>> tryParseAndIgnoreSeparator(final String maybeStringWithDecimal, final Locale locale); static boolean checkIfCorrectDecimalValue(final Entity entity, final String decimalFieldName); static String toString(BigDecimal decimal,int maximumFractionDigits);  }### Answer:
@Test public final void shouldConvertNullToZero() { BigDecimal notNullDecimal = BigDecimal.TEN; BigDecimal fromNullRes = BigDecimalUtils.convertNullToZero(null); BigDecimal fromNotNullRes = BigDecimalUtils.convertNullToZero(notNullDecimal); Assert.assertEquals(0, notNullDecimal.compareTo(fromNotNullRes)); Assert.assertEquals(0, BigDecimal.ZERO.compareTo(fromNullRes)); }