@Override
    protected Result[] run(String value) {
        final Map<String, Object> extractedJson;
        try {
            extractedJson = extractJson(value);
        } catch (IOException e) {
            throw new ExtractorException(e);
        }
        final List<Result> results = new ArrayList<>(extractedJson.size());
        for (Map.Entry<String, Object> entry : extractedJson.entrySet()) {
            results.add(new Result(entry.getValue(), entry.getKey(), -1, -1));
        }

        return results.toArray(new Result[results.size()]);
    }
@Test
    public void testRunWithWhitespaceInNestedKey() throws Exception {
        final String value = "{\"foo\":{\"b a r\":{\"b a z\": 42}}}";
        final JsonExtractor jsonExtractor = new JsonExtractor(
                new MetricRegistry(),
                "json",
                "title",
                0L,
                Extractor.CursorStrategy.COPY,
                "source",
                "target",
                ImmutableMap.of("replace_key_whitespace", true, "key_whitespace_replacement", "-"),
                "user",
                Collections.emptyList(),
                Extractor.ConditionType.NONE,
                "");

        assertThat(jsonExtractor.run(value)).containsOnly(
                new Extractor.Result(42, "foo_b-a-r_b-a-z", -1, -1)
        );
    }