private void processAction(Action<?> action, UpdatingIterator parentIterator) { if (action.act == Action.Act.next || action.act == Action.Act.nextSibling) { // do nothing } else if (action.act == Action.Act.remove) { parentIterator.remove(); } else if (action.act == Action.Act.replace) { AmObject replacement = action.getReplaceWith(); parentIterator.set(replacement); } else throw new AssertionError(action); }