### Question:
DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } return addError(isValid, fieldName, entity, "RFC 3339 DateTime", ErrorType.INVALID_DATE_FORMAT, errors); } DateTimeSchema();  DateTimeSchema(String xsdType); @Override NeutralSchemaType getSchemaType(); @Override Object convert(Object value);  }### Answer:
@Test public void testDateTimeStringValidation() throws IllegalArgumentException { String dateTimeString = "2012-01-01T12:00:00-05:00"; assertTrue("DateTime entity validation failed", schema.validate(dateTimeString)); }
@Test public void testDateTimeValidation() { Calendar calendar = Calendar.getInstance(); String dateTimeString = javax.xml.bind.DatatypeConverter.printTime(calendar); assertTrue("DateTime entity validation failed", schema.validate(dateTimeString)); }
@Test public void testValidationOfStringFailure() { String stringEntity = ""; assertFalse("Expected DateTimeSchema string validation failure did not succeed", schema.validate(stringEntity)); }