### Question:
Body { public static Body from(JsonNode body) { requireNonNull(body, BODY_REQUIRED_ERR_MSG); return new Body(body); } private  Body(Object body); private  Body(JsonNode bodyNode); private  Body(String body); private  Body(InputStream bodyIs); static Body from(JsonNode body); static Body from(Object body); static Body from(String body); static Body from(InputStream body); JsonNode getContentAsNode(final OAIContext context,
                                   final MediaType mediaType,
                                   final String rawContentType);  }### Answer:
@Test public void fromMap() throws Exception { Map<String, Object> values = new HashMap<>(); values.put("key", "value"); Body body = Body.from(values); checkBody(body, TreeUtil.toJsonNode(values)); }
@Test public void fromList() throws Exception { List<Object> values = new ArrayList<>(); values.add(0, "value0"); values.add(1, "value1"); Body body = Body.from(values); checkBody(body, TreeUtil.toJsonNode(values)); }
@Test public void fromBoolean() throws Exception { Boolean value = Boolean.TRUE; Body body = Body.from(value); checkBody(body, TreeUtil.toJsonNode(value)); }
@Test public void fromString() throws Exception { String values = "{\"key\":\"value\"}"; Body body = Body.from(values); checkBody(body, TreeUtil.json.readTree(values)); }
@Test public void fromJsonNode() throws Exception { String values = "{\"key\":\"value\"}"; Body body = Body.from(TreeUtil.json.readTree(values)); checkBody(body, TreeUtil.json.readTree(values)); }
@Test public void fromInputStream() throws Exception { String values = "{\"key\":\"value\"}"; Body body = Body.from(new ByteArrayInputStream(values.getBytes())); checkBody(body, TreeUtil.json.readTree(new ByteArrayInputStream(values.getBytes()))); }