Behavior[] behaviors = Behavior.EMPTY_BEHAVIOR_LIST;
if ( !context.getBehaviors().isEmpty() ) {
behaviors = (Behavior[]) context.getBehaviors().toArray( new Behavior[context.getBehaviors().size()] );
}
CollectAccumulator accumulator = new CollectAccumulator( collect );
Accumulate accumulate = new Accumulate( sourcePattern,
sourcePattern.getRequiredDeclarations(),
(Declaration[]) collect.getInnerDeclarations().values().toArray( new Declaration[0] ),
new Accumulator[] { accumulator });
context.setTupleSource( (LeftTupleSource) utils.attachNode( context,