parent.replace(sj, fused.get(0));
if (fused.get(0) instanceof SIRIdentity && parent instanceof SIRPipeline && parent.size() > 1) { parent.remove(sj); } else { parent.replace(sj, fused.get(0)); }
    private static void replaceInParent(SIRSplitJoin sj,                                        SIRPipeline fused) {        // if parent of <sj> is a pipeline, then copy these children        // in, in place of the original filter        SIRContainer parent = sj.getParent();        // DON'T CONSIDER THIS CASE SINCE IT HINDERS        // PARTITIONING--would like things to end up in their own        // nested pipeline so that pipeline can be fused        if (false) { //parent instanceof SIRPipeline) {            int index = parent.indexOf(sj);            parent.remove(index);            for (int i=fused.size()-1; i>=0; i--) {                parent.add(index, fused.get(i), fused.getParams(i));            }        } else {            // if <fused> has just one filter, add it in place of <sj>            if (fused.size()==1) {                parent.replace(sj, fused.get(0));            } else {                // otherwise, just add <fused> to parent in place of <sj>                parent.replace(sj, fused);                // clear the param list pased to <fused>                parent.getParams(parent.indexOf(fused)).clear();            }        }    }