### Question:
UpdateExpressionList extends UpdateExpression { @Override public JsonNode toJson() { ArrayNode node = getFactory().arrayNode(); for (PartialUpdateExpression x : list != null ? list : Collections.<PartialUpdateExpression>emptyList()) { if (x != null) { node.add(x.toJson()); } } return node; } UpdateExpressionList(List<PartialUpdateExpression> l);  UpdateExpressionList(PartialUpdateExpression... l); List<PartialUpdateExpression> getList(); @Override JsonNode toJson(); static UpdateExpressionList fromJson(ArrayNode node);  }### Answer:
@Test public void testToJson() { PartialUpdateExpression elem = new PartialUpdateExpressionImpl(); UpdateExpressionList instance = new UpdateExpressionList(elem); ArrayNode arrayNode = JsonObject.getFactory().arrayNode(); assertEquals(arrayNode.add(elem.toJson()), instance.toJson()); instance = new UpdateExpressionList((PartialUpdateExpression) null); arrayNode = JsonObject.getFactory().arrayNode(); assertEquals(arrayNode, instance.toJson()); instance = new UpdateExpressionList((List) null); arrayNode = JsonObject.getFactory().arrayNode(); assertEquals(arrayNode, instance.toJson()); }