LanguageCodeValidator implements ValueValidator { @Override public void validate(String value) throws XDSMetaDataException { notNull(value, "value cannot be null"); metaDataAssert(CODE_PATTERN.matcher(value).matches(), INVALID_LANGUAGE_CODE, value); }  @Override void validate(String value);  }
@Test public void testValidateGoodCases() throws XDSMetaDataException { validator.validate("en"); validator.validate("abcdefgh"); validator.validate("en-US"); validator.validate("en-us"); validator.validate("abcdefgh-ab123456"); validator.validate("abcdefgh-ab123456-23"); }