+ final int cnt = list.size();
+ for (int i = 1; i < cnt - 1; i++) {
+ final TransactionAccount item = list.get(i)
+ .toTransactionAccount();
+ if (item.isLast) {
+ TransactionAccount replacement = new TransactionAccount(item);
+ replacement.isLast = false;
+ list.set(i, replacement);
+ }
+ }
+ final TransactionAccount last = list.get(cnt - 1)
+ .toTransactionAccount();
+ if (!last.isLast) {
+ TransactionAccount replacement = new TransactionAccount(last);
+ replacement.isLast = true;
+ list.set(cnt - 1, replacement);
+ }
+
+ if (BuildConfig.DEBUG)
+ dumpItemList("Before setValue()", list);