List<CompositeArrangementSettingsToken> (@NotNull CompositeArrangementSettingsToken base) { List<CompositeArrangementSettingsToken> result = new ArrayList<>(); Queue<CompositeArrangementSettingsToken> toProcess = ContainerUtil.newLinkedList(base); while (!toProcess.isEmpty()) { CompositeArrangementSettingsToken token = toProcess.remove(); result.add(token); toProcess.addAll(token.getChildren()); } return result; }