List<LinkedList<UndoableGroup>> (boolean global, @NotNull Collection<? extends DocumentReference> refs) { List<LinkedList<UndoableGroup>> result = new ArrayList<>(refs.size() + 1); if (global) result.add(myGlobalStack); for (DocumentReference ref : refs) { result.add(getStack(ref)); } return result; }