private void addStages(ArrayList<Stage> stages, NamedGraphMap arguments, Mapping map) {
   Iterator<Map.Entry<String, Cons>> it2 = triples.entrySetIterator();
   while (it2.hasNext()) {
     Map.Entry<String, Cons> e = it2.next();
     String name = e.getKey();
     Cons nodeTriples = e.getValue();
     Graph g = arguments.get(name);
     int nBlocks = Cons.size(nodeTriples), i = nBlocks;
     Triple[] nodes = new Triple[nBlocks];
     while (nodeTriples != null) {
       nodes[--i] = nodeTriples.head;
       nodeTriples = nodeTriples.tail;
     }
     nodes = sortTriples(nodes);
     Stage next = g.queryHandler().patternStage(map, constraint, nodes);
     stages.add(next);
   }
 }
 private static NamedTripleBunches asNamedTripleBunches(List<Triple> pattern) {
   NamedTripleBunches result = new NamedTripleBunches();
   for (Iterator<Triple> elements = pattern.iterator(); elements.hasNext(); )
     result.add(NamedTripleBunches.anon, elements.next());
   return result;
 }