check(new FieldList(3).addFields(2, 8, 5, 7), 3, 2, 8, 5, 7);
}
@Test
public void testImmutability() {
FieldList s1 = new FieldList();
FieldList s2 = new FieldList(5);
FieldList s3 = new FieldList(new Integer(7));
FieldList s4 = new FieldList(5, 4, 7, 6);
s1.addFields(s2).addFields(s3);
s2.addFields(s4);
s4.addFields(s1);
s1.addField(new Integer(14));
s2.addFields(78, 13, 66, 3);
assertEquals(0, s1.size());
assertEquals(1, s2.size());
assertEquals(1, s3.size());
assertEquals(4, s4.size());
}