SIRStream result = str; PartitionGroup childPart = calcPartitionArray(); if (str instanceof SIRPipeline) { FusePipe.fuse((SIRPipeline)str, childPart); } else if (str instanceof SIRSplitJoin) { result = FuseSplit.fuse((SIRSplitJoin)str, childPart);   assert (childPart.size()>1 || str!=result): "Failed to fuse splitjoin: " + result;   if (childPart.size()==1) { if (result instanceof SIRPipeline) {  FusePipe.fuse((SIRPipeline)result); } } else {  for (int i=0; i<childPart.size(); i++) { if (childPart.get(i)>1 && ((SIRSplitJoin)result).get(i) instanceof SIRPipeline) { FusePipe.fuse((SIRPipeline)((SIRSplitJoin)result).get(i)); } } } } else if (str instanceof SIRFeedbackLoop) { Utils.fail("FeedbackLoop fusion not supported"); } else { Utils.fail("Unexpected stream type " + str.getClass() + ": " + str); } return result; }
    public SIRStream doMyTransform(SIRStream str) {	// make sure we have a container	Utils.assert(str instanceof SIRContainer, "Expected container as target of fusion, but got: " + str);	// if we have as many partitions as children, then we're done	if (((SIRContainer)str).size()==partitions.size()-1) {	    return str;	}