### Question:
JsonParser { public Map<String, Object> parseJsonObject(final String jsonString) throws ParseException { this.jsonString = jsonString; this.position = findNextToken(jsonString, 0); if (jsonString.charAt(position) != '{') { throw new ParseException("JSON string does not represent a JSON object.", position); } return parseObject(); } JsonParser(); Map<String, Object> parseJsonObject(final String jsonString);  }### Answer:
@Test void parseAsObject() throws ParseException { final JsonParser parser = new JsonParser(); assertThrows(ParseException.class, () -> parser.parseJsonObject("")); assertThrows(ParseException.class, () -> parser.parseJsonObject("[]")); assertEquals(Collections.singletonMap("moose", true), parser.parseJsonObject(" \t\r\n{ \"moose\"\t: true }\n\n")); }