Iterator<List<InferenceVariable>> (Collection<? extends InferenceVariable> vars, InferenceSession session) { Map<InferenceVariable, InferenceGraphNode<InferenceVariable>> nodes = buildInferenceGraph(vars, session); final ArrayList<InferenceGraphNode<InferenceVariable>> acyclicNodes = initNodes(nodes.values()); return ContainerUtil.map(acyclicNodes, node -> node.getValue()).iterator(); }