FindMessageStatements find = new FindMessageStatements(str); str.getWork().accept(find);
if (str.needsWork()) { FindMessageStatements find = new FindMessageStatements(str); str.getWork().accept(find); }
    private void traverse(SIRStream str)    {        // First, visit children (if any).        if (str instanceof SIRFeedbackLoop)        {            SIRFeedbackLoop fl = (SIRFeedbackLoop)str;            traverse(fl.getBody());            traverse(fl.getLoop());        }        if (str instanceof SIRPipeline)        {            SIRPipeline pl = (SIRPipeline)str;            Iterator iter = pl.getChildren().iterator();            while (iter.hasNext())            {                SIRStream child = (SIRStream)iter.next();                traverse(child);            }        }        if (str instanceof SIRSplitJoin)        {            SIRSplitJoin sj = (SIRSplitJoin)str;            Iterator iter = sj.getParallelStreams().iterator();            while (iter.hasNext())            {                SIRStream child = (SIRStream)iter.next();                traverse(child);            }        }                if (str instanceof SIRFilter || str instanceof SIRPhasedFilter)        {	    	    FindMessageStatements find = new FindMessageStatements(str);	    str.getWork().accept(find);        }    }