CustomDisplay display = new CustomDisplay();
ArrayList failureMessages = new ArrayList();
ConstraintFailure failure_abc =
new ConstraintFailure("abc failed", "value_abc", //NOI18N
"name_abc", "failureMessage_abc", //NOI18N
"genericFailureMessage_abc"); //NOI18N
ConstraintFailure failure_xyz =
new ConstraintFailure("constraint_xyz", "value_xyz", //NOI18N
"name_xyz", "failureMessage_xyz", //NOI18N
"genericFailureMessage_xyz"); //NOI18N
failureMessages.add(failure_abc);
failureMessages.add(failure_xyz);
display.text(failureMessages);
//test to make sure text() reports error, if the Collection it is
//processing has objects that are not of type Failure.
ArrayList failures = new ArrayList();
failures.add(new Integer(5));
failures.add("failure_message"); //NOI18N
display.text(failures);