public static BigDecimal minus(Object minuend, Object subtrahend) {
        if (!minuend.getClass().equals(subtrahend.getClass())) {
            throw new IllegalStateException(
                    String.format(
                            "Unsupported operand type, the minuend type %s is different with subtrahend type %s.",
                            minuend.getClass().getSimpleName(),
                            subtrahend.getClass().getSimpleName()));
        }
        if (minuend instanceof Integer) {
            return BigDecimal.valueOf((int) minuend).subtract(BigDecimal.valueOf((int) subtrahend));
        } else if (minuend instanceof Long) {
            return BigDecimal.valueOf((long) minuend)
                    .subtract(BigDecimal.valueOf((long) subtrahend));
        } else if (minuend instanceof BigInteger) {
            return new BigDecimal(
                    ((BigInteger) minuend).subtract((BigInteger) subtrahend).toString());
        } else if (minuend instanceof BigDecimal) {
            return ((BigDecimal) minuend).subtract((BigDecimal) subtrahend);
        } else {
            throw new UnsupportedOperationException(
                    String.format(
                            "Unsupported type %s for numeric minus.",
                            minuend.getClass().getSimpleName()));
        }
    }
@Test
    public void testMinus() {
        assertEquals(BigDecimal.valueOf(9999), ObjectUtils.minus(10000, 1));
        assertEquals(
                BigDecimal.valueOf(4294967295L),
                ObjectUtils.minus(Integer.MAX_VALUE, Integer.MIN_VALUE));

        assertEquals(BigDecimal.valueOf(9999999999999L), ObjectUtils.minus(10000000000000L, 1L));
        assertEquals(
                new BigDecimal("18446744073709551615"),
                ObjectUtils.minus(Long.MAX_VALUE, Long.MIN_VALUE));

        assertEquals(
                new BigDecimal("99.12344"),
                ObjectUtils.minus(new BigDecimal("100.12345"), new BigDecimal("1.00001")));
    }