ListValue extends PropertyValue { public ListValue addValues(String... values) { List<PropertyValue> result = new ArrayList<>(); for(String val:values) { result.add(addPropertyValue(new PropertyValue(generateListKey(), val))); } return this; } ListValue(String key); @Override ValueType getValueType(); int getIndex(PropertyValue member); @Override int getSize(); @Override Iterator<PropertyValue> iterator(); ListValue addPropertyValue(PropertyValue value); ListValue addValue(String value); ListValue addValues(String... values); ObjectValue addObject(); ListValue addList(); String getValue(int index); PropertyValue getPropertyValue(int n); List<ObjectValue> getObjects(String name); List<ListValue> getLists(String name); List<ListValue> getLists(); List<PropertyValue> getPropertyValues(String name); @Override ObjectValue toObjectValue(); @Override ListValue toListValue(); String getValue(); @Override PropertyValue setValue(String value); @Override ListValue mutable(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static ListValue from(Collection<PropertyValue> values);  }
@Test public void addValues() { ListValue lv = PropertyValue.createList(); lv.addValues("v", "v1", "v"); assertThat(3).isEqualTo(lv.getSize()); assertThat("v").isEqualTo(lv.getPropertyValue(0).getValue()); assertThat("v1").isEqualTo(lv.getPropertyValue(1).getValue()); assertThat("v").isEqualTo(lv.getPropertyValue(2).getValue()); }