### Question:
IsoDateFormatValidator implements Validator { @Override public boolean isValid(String value) { try { DatatypeConverter.parseDateTime(value); return true; } catch (IllegalArgumentException iae) { return false; } }  @Override boolean isValid(String value);  }### Answer:
@Test public void testText() { assertFalse(validator.isValid("some text in here")); assertFalse(validator.isValid("2013-03-12asdf")); assertFalse(validator.isValid("real date in here 2013-05-16")); }
@Test public void testOutOfBoundsDates() { assertFalse(validator.isValid("2013-02-29T01:54:30.207Z")); assertFalse(validator.isValid("1900-02-29T01:54:30.207Z")); assertFalse(validator.isValid("2013-03-29T25:54:30.207Z")); }
@Test public void testWrongFormat() { assertFalse(validator.isValid("01/13/2013")); assertFalse(validator.isValid("2013/01/01")); }
@Test public void testGoodDates() { assertTrue(validator.isValid("2011-03-10T11:54:30.207Z")); assertTrue(validator.isValid("2011-03-10T11:54:30Z")); assertTrue(validator.isValid("2012-02-29T01:54:30.207Z")); assertTrue(validator.isValid("2000-02-29T01:54:30.207Z")); assertTrue(validator.isValid("2013-02-17")); assertTrue(validator.isValid("2013-02-17Z")); }