code: @Override
      public Map<String, Object> readJson(Reader reader) throws IOException {
          // Issue #99 : Take a look at better dealing with root Map<> vs root List<> in the response.
  
          // We are expecting this isn't called on nested nodes in a recursive manner.
          JsonNode rootNode = mapper.readTree(reader);
          Map<String, Object> rootMap = null;
  
          // If we try to parse an empty string or invalid content, we could get null.
          if (null == rootNode) {
              throw new IllegalArgumentException("Empty reader or ill-formatted JSON encountered.");
          } else if (rootNode.isArray()) {
              rootMap = new LinkedHashMap<String, Object>();
              rootMap.put(KeenConstants.KEEN_FAKE_JSON_ROOT,
                          mapper.readValue(rootNode.traverse(), COLLECTION_TYPE));
          } else if (rootNode.isObject()) {
              rootMap = mapper.readValue(rootNode.traverse(), MAP_TYPE);
          }
  
          return rootMap;
      }
docs: {@inheritDoc}