### Question:
Decimal128 extends Number implements Serializable, Comparable<Decimal128> { @Override public int intValue() { return toBigDecimal().intValue(); } Decimal128(long low, long high);  Decimal128(BigDecimal value); private  Decimal128(BigDecimal initialValue, boolean isNegative); static Decimal128 fromNumber(Number value); long getLow(); long getHigh(); BigDecimal toBigDecimal(); @Override String toString(); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Decimal128 o); static final Decimal128 ONE; static final Decimal128 TWO; static final Decimal128 NaN; static final Decimal128 POSITIVE_ZERO; static final Decimal128 NEGATIVE_ZERO; static final Decimal128 POSITIVE_INFINITY; static final Decimal128 NEGATIVE_INFINITY; }### Answer:
@Test void testToInt() throws Exception { assertThat(Decimal128.ONE.intValue()).isEqualTo(1); assertThat(Decimal128.POSITIVE_ZERO.intValue()).isEqualTo(0); assertThat(Decimal128.NEGATIVE_ZERO.intValue()).isEqualTo(0); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(Decimal128.NaN::intValue) .withMessage("NaN cannot be converted to BigDecimal"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(Decimal128.POSITIVE_INFINITY::intValue) .withMessage("Infinity cannot be converted to BigDecimal"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(Decimal128.NEGATIVE_INFINITY::intValue) .withMessage("-Infinity cannot be converted to BigDecimal"); }