subNodeInstance );
}
stream.writeShort( PersisterEnums.END );
} else if ( nodeInstance instanceof ForEachNodeInstance ) {
stream.writeShort( PersisterEnums.FOR_EACH_NODE_INSTANCE );
ForEachNodeInstance forEachNodeInstance = (ForEachNodeInstance) nodeInstance;
List<NodeInstance> nodeInstances = new ArrayList<NodeInstance>( forEachNodeInstance.getNodeInstances() );
Collections.sort( nodeInstances,
new Comparator<NodeInstance>() {
public int compare(NodeInstance o1,
NodeInstance o2) {
return (int) (o1.getId() - o2.getId());