PidValidator implements ValueValidator { @Override public void validate(String value) throws XDSMetaDataException { notNull(value, "value cannot be null"); Matcher matcher = PID_PATTERN.matcher(value); metaDataAssert(matcher.matches(), INVALID_PID, value); int number = Integer.parseInt(matcher.group(1)); metaDataAssert(number != 2 && number != 4 && number != 12 && number != 19, UNSUPPORTED_PID, value); }  @Override void validate(String value);  }
@Test public void testValidateGoodCases() throws XDSMetaDataException { validator.validate("PID-3|"); validator.validate("PID-3|something"); validator.validate("PID-44|something"); }