// retrieve complex property
String getter = TypeTestingHelper.calculateArrayGetter(fieldName) + "Property";
Method getcp = getSchemaClass().getMethod(getter, new Class[0]);
Object ocp = getcp.invoke(getSchema(), new Object[0]);
Assert.assertTrue(ocp instanceof ArrayProperty);
ArrayProperty cp = (ArrayProperty) ocp;
// check size is ok (1)
Assert.assertEquals(1, cp.getContainer().getAllProperties().size());
// add a new one
Object value2 = TypeTestingHelper.getJavaValue(type);
set.invoke(getSchema(), new Object[] { value2 });
Assert.assertEquals(2, cp.getContainer().getAllProperties().size());
// remove the first
String remover = "remove" + TypeTestingHelper.calculateFieldNameForMethod(fieldName);
Method remove = getSchemaClass().getMethod(remover, new Class<?>[] { TypeTestingHelper.getJavaType(type) });
remove.invoke(getSchema(), value1);
Assert.assertEquals(1, cp.getContainer().getAllProperties().size());
}