### Question:
Numbers { public static boolean valuesAreEqual(@Nullable final Number x, @Nullable final Number y) { if (x == y) return true; if (x == null || y == null) return false; return x.getClass() == y.getClass() ? x.equals(y) : x.toString().equals(y.toString()); }  static boolean valuesAreEqual(@Nullable final Number x, @Nullable final Number y); @SuppressWarnings("unchecked") @Contract(value = "_,!null -> !null; _,null -> null", pure = true) static N convertNumber(final Class<N> numberClass, final Number number); @Contract(value = "!null -> !null; null -> null", pure = true) static Number convertNumberSmartly(final BigDecimal decimal); static int parseIntSafe(@Nullable final String str); static long parseLongSafe(@Nullable final String str); static final Byte BYTE_ZERO; static final BigDecimal DECIMAL_ZERO; static final BigDecimal DECIMAL_MIN_LONG; static final BigDecimal DECIMAL_MAX_LONG; }### Answer:
@Test public void valuesAreEqual_basic() { assertThat(valuesAreEqual(123, 123L)).isTrue(); assertThat(valuesAreEqual(123, BigInteger.valueOf(123L))).isTrue(); assertThat(valuesAreEqual(123.45f, new BigDecimal("123.45"))).isTrue(); }
@Test public void valuesAreEqual_nulls() { assertThat(valuesAreEqual(null, null)).isTrue(); assertThat(valuesAreEqual(111, null)).isFalse(); assertThat(valuesAreEqual(null, 222)).isFalse(); }