#**##set( $imports = $engine.getFromInformation("imports") )
#**##set( $return = $imports.addToImports("java.util.*") )
#**##set( $postfix = "$mofutility.upFirstChar($sourceName)To$mofutility.upFirstChar($targetName)" )
#**##set( $iter = "fujaba__Iter$postfix" )
#**##set( $children = $mofutility.indent("      ",$!children) )
#**##set( $localVars = $engine.getFromInformation("localVars") )
#**##set( $return = $localVars.addLocalVariable($iter, "Iterator", $link) )
#**##set( $range = $mofutility.nullIfEmpty($link.getRange()))
#**#
#**#// iterate to-many link
#**#
#**##if ( $targetSet )
#*   *#	#set( $return = $imports.addToImports("de.upb.tools.fca.*") )
#*   *#	#set( $return = $localVars.addLocalVariable($collectionName, "FHashSet", $link) )
#*   *#	$collectionName = new FHashSet ();
#**##else
#*   *#	fujaba__Success = false;
#**##end
#**#
#**##if( $path )
#*   *#	$iter = new de.uni_kassel.sdm.Path ($sourceName, "$path");
#**##else
#**#	$iter = #if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.##
#*   *#	#if($mparam||$range)
#*      *#		listIterator##
#*   *#	#else
#*      *#		iterator##
#*   *#	#end
#**#	(#if($!mparam)#if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.indexOf($mparam)+1#elseif($range)Math.max(0,Math.min($range,#if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.size()))#end);
#**##end
#**#
#**##if ( $upperbound )
#*   *#	fujaba__UpperBound_$postfix = false;
#*   *#	#set( $return = $localVars.addLocalVariable("fujaba__UpperBound_$postfix","boolean","false", $link) )
#*   *#	#set( $upperadd = " && !(fujaba__UpperBound_$postfix)" )
#**##end
#**#while ( #if(!$forEach && !$targetSet || $targetNegative)!(fujaba__Success) && #end${iter}.hasNext ()$!upperadd )
#**#{
#**#   try
#**#   {
#**##if($check)
#*   *#      JavaSDM.ensure (${targetName}.equals (${iter}.next ()));
#**##else
#*   *#	#set( $typeCast = (!$role.getTarget().equals($target.getInstanceOf())) )
#**#	#set( $source = "#if(!$typeCast)($fullJavaNameOfTargetType)#end ${iter}.next ()" )
#*   *#	#set( $toMany = true )
#*   *#	$mofutility.indent("      ", "#parse( 'jmi/default:storyPattern/object/assign.vm' )" )##
#*   *#	#if ( $upperbound )
#*      *#    	if ( ${targetName}.equals ($upperbound) )
#*      *#	  {
#*      *#         fujaba__UpperBound_$postfix = true;
#*      *#         throw new JavaSDMException () ;
#*      *#      }
#*   *#	#end
#**##end
#**#
#**#$!children
#**#
#**##if ( $targetSet )
#*   *#      ${collectionName}.add ($targetName);
#**##else
#*   *#      fujaba__Success = true;
#**##end
#**#   }
#**#   catch ( JavaSDMException fujaba__InternalException )
#**#   {
#**#      fujaba__Success = false;
#**#   }
#**#}
#**##if ( $targetOptional )
#*   *#	if (!fujaba__Success)
#*   *#	{
#*   *#	   fujaba__Success = true;
#*   *#	   $targetName = null;
#*   *#	}
#**##elseif ( !$targetSet )
#*   *#	JavaSDM.ensure (fujaba__Success);
#**##end
