Assert.assertThat(o.find(model, "foo.map['bar5']"), nullValue());
Assert.assertThat(o.find(model, "ok"), nullValue());
}
public static void main(String[] args) {
ObjectNavigator o = ObjectNavigator.getInstance();
Foo foo = new Foo();
Bar bar = new Bar();
bar.setInfo("bar1");
bar.setSerialNumber(33L);
bar.setPrice(3.30);
foo.setBar(bar);
Map<String, Bar> fooMap = new HashMap<String, Bar>();
bar = new Bar();
bar.setInfo("bar2");
bar.setSerialNumber(23L);
bar.setPrice(2.30);
fooMap.put("bar2", bar);
foo.setMap(fooMap);
Map<String, Object> map2 = new HashMap<String, Object>();
Map<String, Object> map3 = new HashMap<String, Object>();
map3.put("hello", "world");
map3.put("hello3", "world3");
map3.put("arr", Arrays.asList(5,6,7));
Map<String, Object> map4 = new HashMap<String, Object>();
map4.put("hello4", map3);
map2.put("map3", map3);
map2.put("map4", map4);
foo.setMap2(map2);
Model model = new ModelMock();
model.put("foo", foo);
System.out.println(o.find(model, "foo.bar.info"));
System.out.println(o.find(model, "foo.bar.info"));
System.out.println(o.find(model, "foo.bar.serialNumber"));
System.out.println(o.find(model, "foo.bar.price"));
System.out.println(o.find(model, "foo.numbers[2]"));
System.out.println(o.find(model, "foo.bags[2]"));
System.out.println(o.find(model, "foo.map['bar2']"));
System.out.println(o.find(model, "foo.map['bar2'].price"));
System.out.println(o.find(model, "foo.map['bar4']"));
System.out.println(o.find(model, "user.name"));
System.out.println(o.find(model, "foo.map2['map4']['hello4']['hello3']"));
System.out.println(o.find(model, "foo.map2['map4']['hello4']['arr'][2]"));
// long start = System.currentTimeMillequalTo();
// for (int i = 0; i < 1000000; i++) {
// o.find(model, "foo.numbers[2]");
// }