void (@NotNull Consumer<? super DataNode<?>> consumer) { ArrayDeque<DataNode<?>> toProcess = new ArrayDeque<>(); toProcess.add(this); DataNode<?> node; while ((node = toProcess.pollFirst()) != null) { consumer.accept(node); if (node.children != null) { toProcess.addAll(node.children); } } }