JsonXMLArrayProvider provider = new JsonXMLArrayProvider(null);
Annotation[] annotations = new Annotation[0];
Type type = getClass().getDeclaredField("sampleRootElementList").getGenericType();
List<SampleRootElement> list = new ArrayList<SampleRootElement>();
list.add(new SampleRootElement());
list.get(0).attribute = "hello";
list.add(new SampleRootElement());
list.get(1).attribute = "world";
StringWriter writer = new StringWriter();
provider.write(List.class,
type, annotations, MediaType.APPLICATION_JSON_TYPE, null, writer, list);