FunctionInputDef extends Annotated { public VarDef findVarDefPath( String pathName) { IVarDef var = findVarPath( pathName); return var != null && var.getClass().equals( VarDef.class) ? (VarDef) var : null; } FunctionInputDef();  FunctionInputDef( String name); void setName( String name); String getName(); FunctionInputDef addVarDef( IVarDef varDef); FunctionInputDef removeVarDef( String name); IVarDef getVarDef( String name); Iterator<IVarDef> getVarDefs(); String[] getVarTypes(); IVarDef findVarPath( String pathName); VarDef findVarDefPath( String pathName); int hashCode(); boolean equals( Object object); String toString();  }
@Test public void findVarDefPath_Unknown() { FunctionInputDefBuilder functionInputDefBuilder = new FunctionInputDefBuilder(); functionInputDefBuilder.varDefAtPath( "A.B.C.D"); FunctionInputDef functionInputDef = functionInputDefBuilder.build(); VarDef var; var = functionInputDef.findVarDefPath( "A"); assertThat( "Top-level VarSet", var, is( (Object) null)); var = functionInputDef.findVarDefPath( "A.B.C"); assertThat( "Ancestor VarSet", var, is( (Object) null)); var = functionInputDef.findVarDefPath( "A.B.C.E"); assertThat( "Unknown end", var, is( (Object) null)); }
@Test public void findVarDefPath_VarDef() { FunctionInputDefBuilder functionInputDefBuilder = new FunctionInputDefBuilder(); functionInputDefBuilder.varDefAtPath( "A.B.C.D"); FunctionInputDef functionInputDef = functionInputDefBuilder.build(); VarDef var; var = functionInputDef.findVarDefPath( "A.B.C.D"); assertThat( "Descendant", var.getPathName(), is( "A.B.C.D")); functionInputDefBuilder.varDefAtPath( "X"); functionInputDef = functionInputDefBuilder.build(); var = functionInputDef.findVarDefPath( "X"); assertThat( "Top-level", var != null, is( true)); }