### Question:
Response extends BaseResponse { public JsonNode getEntityData() { return entityData; } Response(JsonNodeFactory jsonNodeFactory, OperationStatus status);  Response(Response r);  Response(BaseResponse r); void setResultSizeThresholds(int maxResultSetSizeB, int warnResultSetSizeB, final Request forRequest); JsonNode getEntityData(); void setEntityData(JsonNode node); void addEntityData(JsonNode doc); List<ResultMetadata> getResultMetadata(); void setResultMetadata(List<ResultMetadata> l); @Override JsonNode toJson(); int getResponseDataSizeB(); static final String ERR_RESULT_SIZE_TOO_LARGE; }### Answer:
@Test public void testWithEntityDataObject() { node = JsonNodeFactory.withExactBigDecimals(true).objectNode(); builder.withEntityData(node); assertTrue(node.equals(builder.buildResponse().getEntityData().get(0))); }
@Test public void testWithEntityDataArray() { node = JsonNodeFactory.withExactBigDecimals(true).arrayNode(); ArrayNode anode = (ArrayNode) node; anode.add(anode.objectNode()); anode.add(anode.objectNode()); builder.withEntityData(node); assertEquals(2, builder.buildResponse().getEntityData().size()); assertTrue(node.equals(builder.buildResponse().getEntityData())); }
@Test public void testWithEntityDataNull() { node = JsonNodeFactory.withExactBigDecimals(true).objectNode(); builder.withEntityData(null); assertFalse(node.equals(builder.buildResponse().getEntityData())); }