public static long btcToSatoshi(BigDecimal coins) throws ArithmeticException {
        return coins.movePointRight(SMALLEST_UNIT_EXPONENT).longValueExact();
    }
@Test
    public void testBtcToSatoshi() {
        assertEquals(Long.MIN_VALUE, btcToSatoshi(new BigDecimal("-92233720368.54775808")));
        assertEquals(0L, btcToSatoshi(BigDecimal.ZERO));
        assertEquals(COIN.value, btcToSatoshi(BigDecimal.ONE));
        assertEquals(Long.MAX_VALUE, btcToSatoshi(new BigDecimal("92233720368.54775807")));
    }