public static Metadata fromJson(Reader reader) throws IOException {
        Metadata m = null;
        try (JsonParser jParser = new JsonFactory()
                .setStreamReadConstraints(StreamReadConstraints
                        .builder()
                        .maxStringLength(TikaConfig.getMaxJsonStringFieldLength())
                        .build())
                .createParser(CloseShieldReader.wrap(reader))) {
            m = readMetadataObject(jParser);
        }
        return m;
    }
@Test
    public void testDeserializationException() {
        //malformed json; 500,000 should be in quotes
        String json = "{\"k1\":[\"v1\",\"v2\"],\"k3\":\"v3\",\"k4\":500,000}";
        boolean ex = false;
        try {
            Metadata deserialized = JsonMetadata.fromJson(new StringReader(json));
        } catch (IOException e) {
            ex = true;
        }
        assertTrue(ex);
    }