assertEquals(l.get(2).getTitle(), iterator.next().getElement("title").getStringValue());
}
public void testBeanMap() throws Exception
{
JavaMapBean mb = new JavaMapBean();
Map<String, Book> m = new HashMap<String, Book>();
m.put("test", junitBook);
mb.setHashMap((HashMap<String, Book>)m);
List<Book> l = new ArrayList<Book>();
l.add(junitBook);
l.add(csharpBook);
l.add(javaScriptBook);
Map<String, List<Book>> hu = new HashMap<String, List<Book>>();
hu.put("1", l);
hu.put("2", l);
hu.put("3", l);
mb.setMapList(hu);
Map<String, String> str = new HashMap<String, String>();
str.put("key1", "value1");
str.put("key2", "value2");
str.put("key3", "value3");
mb.setStrings(str);
JsonValue jsonValue = new JsonGeneratorImpl().createJsonObject(mb);
assertEquals(str.get("key2"), jsonValue.getElement("strings").getElement("key2").getStringValue());
assertNotNull(jsonValue.getElement("hashMap"));