### Question:
UpdateExpressionList extends UpdateExpression { public List<PartialUpdateExpression> getList() { return list; } UpdateExpressionList(List<PartialUpdateExpression> l);  UpdateExpressionList(PartialUpdateExpression... l); List<PartialUpdateExpression> getList(); @Override JsonNode toJson(); static UpdateExpressionList fromJson(ArrayNode node);  }### Answer:
@Test @Ignore public void testContructors() { List<PartialUpdateExpression> list = new ArrayList<>(); PartialUpdateExpression elem = new PartialUpdateExpression() { @Override public JsonNode toJson() { throw new UnsupportedOperationException("Not supported"); } }; list.add(elem); list.add(elem); list.add(elem); UpdateExpressionList iList = new UpdateExpressionList(list); UpdateExpressionList iArray = new UpdateExpressionList(elem, elem, elem); assertEquals("The size of the instances are different", iList.getList().size(), iArray.getList().size()); assertEquals(3, iList.getList().size()); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(0), iArray.getList().get(0)); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(1), iArray.getList().get(1)); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(2), iArray.getList().get(2)); iList.getList().add(elem); iArray.getList().add(elem); assertEquals("The size of the instances are different", iList.getList().size(), iArray.getList().size()); assertEquals(4, iList.getList().size()); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(0), iArray.getList().get(0)); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(1), iArray.getList().get(1)); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(2), iArray.getList().get(2)); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(3), iArray.getList().get(3)); }
@Test public void testContructorsSimpleVersionDueStrangeBehaviorAbove() { List<PartialUpdateExpression> list = new ArrayList<>(); PartialUpdateExpression elem = new PartialUpdateExpression() { @Override public JsonNode toJson() { throw new UnsupportedOperationException("Not supported"); } }; list.add(elem); list.add(elem); list.add(elem); UpdateExpressionList iList = new UpdateExpressionList(list); UpdateExpressionList iArray = new UpdateExpressionList(elem, elem, elem); assertEquals("The size of the instances are different", iList.getList().size(), iArray.getList().size()); assertEquals(3, iList.getList().size()); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(0), iArray.getList().get(0)); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(1), iArray.getList().get(1)); assertEquals("The element is diffent (maybe in a different order)", iList.getList().get(2), iArray.getList().get(2)); }
@Test public void testGetList() { PartialUpdateExpression elem0 = new PartialUpdateExpressionImpl(); UpdateExpressionList instance = new UpdateExpressionList(elem0); assertNotNull(instance.getList()); assertEquals(1, instance.getList().size()); assertNotNull(instance.getList().get(0)); assertEquals("The element using the constructor is different", elem0, instance.getList().get(0)); }