if( !containsVertex( replacement ) )
addVertex( replacement );
for( Scope scope : incoming )
{
FlowElement source = getEdgeSource( scope );
removeEdge( source, element ); // remove scope
// drop edge between, if any
if( source != replacement )
addEdge( source, replacement, scope ); // add scope back
}
for( Scope scope : outgoing )
{
FlowElement target = getEdgeTarget( scope );
removeEdge( element, target ); // remove scope
// drop edge between, if any
if( target != replacement )
addEdge( replacement, target, scope ); // add scope back