TimeValidator implements ValueValidator { @Override public void validate(String time) throws XDSMetaDataException { notNull(time, "time cannot be null"); metaDataAssert(TIME_PATTERN.matcher(time).matches(), INVALID_TIME, time); }  @Override void validate(String time);  }
@Test public void testValidateGoodCases() throws XDSMetaDataException { validator.validate("1980"); validator.validate("198001"); validator.validate("198012"); validator.validate("19800101"); validator.validate("19800131"); validator.validate("1980010100"); validator.validate("1980010123"); validator.validate("198001010100"); validator.validate("198001010159"); validator.validate("19800101010100"); validator.validate("19800101010159"); }