List<XValueGroupNodeImpl> (List<? extends XValueGroup> groups, @Nullable List<XValueGroupNodeImpl> prevNodes, List<? super XValueContainerNode<?>> newChildren) { if (groups.isEmpty()) return prevNodes; List<XValueGroupNodeImpl> nodes = prevNodes != null ? prevNodes : new SmartList<>(); for (XValueGroup group : groups) { XValueGroupNodeImpl node = new XValueGroupNodeImpl(myTree, this, group); nodes.add(node); newChildren.add(node); } return nodes; }