private static boolean isUndoOrRedoAvailable(@Nullable ClientState state,
                                               @NotNull Collection<? extends DocumentReference> refs,
                                               boolean isUndo) {
    if (state == null) return false;
    if (isUndo && state.myMerger.isUndoAvailable(refs)) return true;
    UndoRedoStacksHolder stackHolder = getStackHolder(state, isUndo);
    return stackHolder.canBeUndoneOrRedone(refs);
  }
private static boolean isUndoOrRedoAvailable(@Nullable ClientState state,
                                               @NotNull Collection<? extends DocumentReference> refs,
                                               boolean isUndo)