fields.add(min(fieldIndex + 1, fields.size()), field);
}
- /**
- * Removes the given field.
- *
- * @param field
- * The field to remove
- */
public void removeField(Field field) {
checkNotNull(field, "field must not be null");
- checkArgument(hasField(field), "field must belong to this profile");
fields.remove(field);
}
}
@Test
+ public void testDeletingANonExistingField() {
+ Field testField = profile.addField("TestField");
+ profile.removeField(testField);
+ profile.removeField(testField);
+ }
+
+ @Test
public void testGettingFieldList() {
Field firstField = profile.addField("First");
Field secondField = profile.addField("Second");