FieldList extends FieldSet { @Override public FieldList addFields(int... fieldIDs) { if (fieldIDs == null || fieldIDs.length == 0) { return this; } if (size() == 0) { return new FieldList(fieldIDs); } else { ArrayList<Integer> list = new ArrayList<Integer>(size() + fieldIDs.length); list.addAll(this.collection); for (int i = 0; i < fieldIDs.length; i++) { list.add(fieldIDs[i]); } return new FieldList(Collections.unmodifiableList(list)); } } FieldList();  FieldList(int fieldId);  FieldList(Integer fieldId);  FieldList(int... columnIndexes); private  FieldList(List<Integer> fields); @Override FieldList addField(Integer fieldID); @Override FieldList addFields(int... fieldIDs); @Override FieldList addFields(FieldSet set); Integer get(int pos); @Override FieldList toFieldList(); @Override boolean isValidSubset(FieldSet set); boolean isValidSubset(FieldList list); boolean isValidUnorderedPrefix(FieldSet set); boolean isExactMatch(FieldList list); static final FieldList EMPTY_LIST; }
@Test public void testAddSetToList() { check(new FieldList().addFields(new FieldSet(1)).addFields(2), 1, 2); check(new FieldList().addFields(1).addFields(new FieldSet(2)), 1, 2); check(new FieldList().addFields(new FieldSet(2)), 2); }