void (@NotNull UndoableGroup from) { if (LOG.isDebugEnabled()) { LOG.debug("Clearing " + getStacksDescription() + " from " + from.dumpState()); } for (LinkedList<UndoableGroup> each : getAffectedStacks(from)) { int pos = each.indexOf(from); if (pos == -1) continue; if (pos > 0) { int top = each.size() - pos; clearStacksFrom(each.get(pos - 1)); assert each.size() == top && each.indexOf(from) == 0; } each.removeFirst(); } from.invalidateChangeRanges(); }