@Test
public void testNestedStructure() throws JSONException {
String json = "{\"title\":\"The Matrix\",\"year\":1999,\"cast\":[\"Keanu Reaves\",\"Laurence Fishburne\",\"Carrie-Anne Moss\"]}";
JsonParser parser = Json.createParser(new StringReader(json));
assertEquals(JsonParser.Event.START_OBJECT, parser.next());
assertEquals(JsonParser.Event.KEY_NAME, parser.next());
assertEquals(JsonParser.Event.VALUE_STRING, parser.next());
assertEquals(JsonParser.Event.KEY_NAME, parser.next());
assertEquals(JsonParser.Event.VALUE_NUMBER, parser.next());
assertEquals(JsonParser.Event.KEY_NAME, parser.next());
assertEquals(JsonParser.Event.START_ARRAY, parser.next());
assertEquals(JsonParser.Event.VALUE_STRING, parser.next());
assertEquals(JsonParser.Event.VALUE_STRING, parser.next());
assertEquals(JsonParser.Event.VALUE_STRING, parser.next());
assertEquals(JsonParser.Event.END_ARRAY, parser.next());
assertEquals(JsonParser.Event.END_OBJECT, parser.next());
}