Also, this will produce rounding errors. It should be something like:
```java
return amount.scaleByPowerOfTen(currency.getDefaultFractionDigits()).setScale(0, RoundingMode.HALF_UP).longValue();
```