private void trimInvalid(@NotNull List<ImmutableActionChangeRange> stack) {
    Iterator<ImmutableActionChangeRange> iterator = stack.iterator();
    while (iterator.hasNext()) {
      ImmutableActionChangeRange next = iterator.next();
      if (isValid(next)) {
        return;
      }

      iterator.remove();
    }
  }
private void trimInvalid(@NotNull List<ImmutableActionChangeRange> stack)