### Question:
Thing { public static Thing fromJson(String json) { try { return JSON_MAPPER.readValue(json, Thing.class); } catch (IOException e) { log.warn("Unable to read json", e); return null; } } @SuppressWarnings("squid:S107")  Thing(String objectType,
          Context objectContext,
          String id,
          String title,
          Map<String, String> titles,
          String description,
          Map<String, String> descriptions,
          Map<String, P> properties,
          Map<String, A> actions,
          Map<String, E> events,
          List<Form> forms,
          List<String> security,
          Map<String, SecurityScheme> securityDefinitions,
          String base);  Thing(); String getObjectType(); Context getObjectContext(); String getTitle(); Map<String, String> getTitles(); String getDescription(); Map<String, String> getDescriptions(); List<Form> getForms(); P getProperty(String name); Map<String, A> getActions(); A getAction(String name); Map<String, E> getEvents(); E getEvent(String name); String getBase(); @Override int hashCode(); String getId(); @Override boolean equals(Object obj); @Override String toString(); String toJson(); String toJson(boolean prettyPrint); Map<String, P> getPropertiesByObjectType(String objectType); Map<String, P> getPropertiesByExpandedObjectType(String objectType); String getExpandedObjectType(String objectType); Map<String, P> getProperties(); static String randomId(); static Thing fromJson(String json); static Thing fromJson(File json); static Thing fromMap(Map<String, Map> map);  }### Answer:
@Test public void fromJson() { String json = "{" + " \"id\":\"Foo\",\n" + " \"description\":\"Bar\",\n" + " \"@type\":\"Thing\",\n" + " \"@context\":[\"http: " \"securityDefinitions\": {\n" + " \"basic_sc\": {\n" + " \"scheme\": \"basic\",\n" + " \"in\": \"header\"\n" + " }\n" + " }," + " \"security\": [\"basic_sc\"]\n" + "}"; Thing thing = Thing.fromJson(json); assertEquals("Foo", thing.getId()); assertEquals("Bar", thing.getDescription()); assertEquals("Thing", thing.getObjectType()); assertEquals(new Context("http: assertEquals(Map.of("basic_sc", new BasicSecurityScheme("header")), thing.getSecurityDefinitions()); assertEquals(List.of("basic_sc"), thing.getSecurity()); }