Node extends NestedNode implements IParserNode { public List< IParserNode > findPrimaryStatementsFromNameInChildren( final String[] names ) { final List< IParserNode > foundNode = new ArrayList< IParserNode >(); if ( getStringValue() != null && isNameInArray( names, getStringValue() ) ) { foundNode.add( this ); } else if ( numChildren() != 0 ) { for ( final IParserNode child : getChildren() ) { foundNode.addAll( child.findPrimaryStatementsFromNameInChildren( names ) ); } } return foundNode; } private  Node( final NodeKind idToBeSet,
                 final int lineToBeSet,
                 final int columnToBeSet ); private  Node( final NodeKind idToBeSet,
                 final int lineToBeSet,
                 final int columnToBeSet,
                 final IParserNode childToBeSet ); private  Node( final NodeKind idToBeSet,
                 final int lineToBeSet,
                 final int columnToBeSet,
                 final String valueToBeSet ); List< IParserNode > findPrimaryStatementsFromNameInChildren( final String[] names ); int getColumn(); int getLine(); String getStringValue(); @Override String toString();  }
@Test public void testFindPrimaryStatementsFromNameInChildren() throws TokenException { final Node ast = parseFunction( "function set a( value : int ) : void { trace(\"lala\")}" ); assertEquals( 2, ast.findPrimaryStatementsFromNameInChildren( new String[] { "trace", "\"lala\"" } ).size() ); }