@Override
    public void emit(String emitKey, List<Metadata> metadataList, ParseContext parseContext) throws IOException, TikaEmitterException {
        if (metadataList == null || metadataList.isEmpty()) {
            throw new TikaEmitterException("metadata list must not be null or of size 0");
        }
        //TODO: estimate size of metadata list.  Above a certain size,
        //create a temp file?
        UnsynchronizedByteArrayOutputStream bos = UnsynchronizedByteArrayOutputStream
                .builder()
                .get();
        try (Writer writer = new OutputStreamWriter(bos, StandardCharsets.UTF_8)) {
            JsonMetadataList.toJson(metadataList, writer);
        } catch (IOException e) {
            throw new TikaEmitterException("can't jsonify", e);
        }
        Metadata metadata = new Metadata();
        emit(emitKey, TikaInputStream.get(bos.toByteArray(), metadata), metadata, parseContext);

    }
@Test
    public void testBasic() throws Exception {
        EmitterManager emitterManager = EmitterManager.load(getConfig("tika-config-az-blob.xml"));
        Emitter emitter = emitterManager.getEmitter("az-blob");
        List<Metadata> metadataList = new ArrayList<>();
        Metadata m = new Metadata();
        m.set("k1", "v1");
        m.add("k1", "v2");
        m.set("k2", "v3");
        m.add("k2", "v4");
        metadataList.add(m);
        emitter.emit("something-or-other/test-out", metadataList, new ParseContext());
    }