assertEquals("cde", strs.get(2));
}
public void testUseState(){
final Container yan = createYanContainer();
yan.registerComponent("allnul", Components.useState(new Predicate(){
public boolean isObject(Object obj){
return obj==null;
}
public String toString(){return "isnull";}
}).withState("!do not recurse on me"));
yan.registerComponent("startswithhello", Components.useState(new Predicate(){
public boolean isObject(Object obj){
if(obj instanceof String){
final String s = (String)obj;
return s.startsWith("hello");
}