boolean canBeUndoneOrRedone(@NotNull Collection<? extends DocumentReference> refs) {
    if (refs.isEmpty()) return !myGlobalStack.isEmpty() && myGlobalStack.getLast().isValid();
    for (DocumentReference each : refs) {
      if (!getStack(each).isEmpty() && getStack(each).getLast().isValid()) return true;
    }
    return false;
  }
boolean canBeUndoneOrRedone(@NotNull Collection<? extends DocumentReference> refs)