@Override
public final void writeList(Class<?> elementType, Collection<?> t, MediaType mediaType, Charset c, Marshaller m, OutputStream entityStream) throws JAXBException, IOException {
final OutputStreamWriter osw = new OutputStreamWriter(entityStream, c);
JSONConfiguration origJsonConfig = JSONConfiguration.DEFAULT;
if (m instanceof JSONConfigurated) {
origJsonConfig = ((JSONConfigurated)m).getJSONConfiguration();
}
final JSONConfiguration unwrappingJsonConfig =
JSONConfiguration.createJSONConfigurationWithRootUnwrapping(origJsonConfig, true);
final XMLStreamWriter jxsw = Stax2JsonFactory.createWriter(osw, unwrappingJsonConfig, elementType, getStoredJAXBContext(elementType), true);
final String invisibleRootName = getRootElementName(elementType);
final String elementName = getElementName(elementType);