if( priorResults == null )
return elementGraph;
// the results are sub-graphs of the elementGraph, so guaranteed to exist in graph
AnnotatedGraph resultGraph = new ElementDirectedGraph( elementGraph );
for( ElementGraph result : priorResults )
{
if( !( result instanceof AnnotatedGraph ) || !( (AnnotatedGraph) result ).hasAnnotations() )
continue;
EnumMultiMap<FlowElement> annotations = ( (AnnotatedGraph) result ).getAnnotations();
resultGraph.getAnnotations().addAll( annotations );
}
return (ElementGraph) resultGraph;
}