}
@Test
public void elementData() throws Exception {
final List<StateWriter> elements = new ArrayList<StateWriter>();
final StateWriter elementWriter1 = writer.createElementWriter();
elementWriter1.writeField("number", "1");
elements.add(elementWriter1);
final StateWriter elementWriter2 = writer.createElementWriter();
elementWriter2.writeField("number", "4");
elements.add(elementWriter2);
writer.writeCollection("coll", elements);
assertEquals("{\"coll\": [\n {\"number\": \"1\"},\n {\"number\": \"4\"}\n]}", writer.getData());