+ if (emptyAmountAccounts.size() > 0) {
+ if (emptyAmountAccounts.size() > 1 && !Misc.isZero(emptyAmountAccountBalance))
+ throw new RuntimeException(String.format(Locale.US,
+ "Should not happen. %d accounts with non zero amount to distribute (%5" +
+ ".3f)"));
+ for (LedgerTransactionAccount a : emptyAmountAccounts)
+ a.setAmount(-emptyAmountAccountBalance);
+ }