private static void collectAggregatesForDirectMatchers(NodeState nodeState, List<Matcher> matchers, ResultCollector collector) { Map<String, ChildNodeEntry> children = Maps.newHashMap(); //Collect potentially matching child nodestates based on matcher name for (Matcher m : matchers){ String nodeName = m.getNodeName(); NodeState child = nodeState.getChildNode(nodeName); if (child.exists()){ children.put(nodeName, new MemoryChildNodeEntry(nodeName, child)); } } matchChildren(matchers, collector, children.values()); }