@PUT
    @Consumes("application/json")
    @Produces("application/json")
    @Path("compare")
    public Map<String, Object> compare(InputStream is) throws Exception {
        JsonNode node = null;
        try (BufferedReader reader = new BufferedReader(
                new InputStreamReader(is, StandardCharsets.UTF_8))) {
            node = new ObjectMapper().readTree(reader);
        }
        String id = node.get(ID).asText();
        String textA = node.get(TEXT_A).asText();
        String textB = node.get(TEXT_B).asText();
        long timeoutMillis = node.has("timeoutMillis") ? node.get("timeoutMillis").asLong() :
                DEFAULT_TIMEOUT_MILLIS;
        return compareText(id, textA, textB, timeoutMillis);
    }
@Test
    public void testBasicCompare() throws Exception {
        Map<String, String> request = new HashMap<>();
        request.put(TikaEvalResource.ID, "1");
        request.put(TikaEvalResource.TEXT_A, "the quick brown fox jumped qwertyuiop");
        request.put(TikaEvalResource.TEXT_B, "the the the fast brown dog jumped qwertyuiop");
        Response response = compare(request);
        Map<String, Object> results = deserialize(response);
        assertEquals(6,
                (int)results.get(TikaEvalMetadataFilter.NUM_TOKENS.getName() + "A"));
        assertEquals(0.166,
                (double)results.get(TikaEvalMetadataFilter.OUT_OF_VOCABULARY.getName() + "A"),
                0.01);
        assertEquals("eng", results.get(TikaEvalMetadataFilter.LANGUAGE.getName() + "A"));

        assertEquals(0.666, (double)results.get(TikaEvalResource.DICE.getName()), 0.01);
        assertEquals(0.571, (double)results.get(TikaEvalResource.OVERLAP.getName()), 0.01);
    }