TabFileParameter implements IStringConverter<List<FileGraphDelimiter>>, IParameterValidator { @Override public void validate(String name, String value) throws ParameterException { int delimIndex; int nameIndex; String[] values = value.split(","); for (String val : values) { delimIndex = val.indexOf(DELIMITER_SEP_CHARACTER); nameIndex = val.indexOf(NAME_SEP); if (delimIndex > -1 && nameIndex > -1) { if (delimIndex < nameIndex) { throw new ParameterException("Parameter " + name + " and value " + val + " must have delimiter (" + delimIndex + ") after graph name (" + nameIndex + ")."); } } if (delimIndex > -1) { DELIMITER_VALIDATOR.validate(name, val.substring(delimIndex)); } } }  @Override List<FileGraphDelimiter> convert(String value); FileGraphDelimiter build(String value); @Override void validate(String name, String value);  }
@Test(expected = ParameterException.class) public void testValidate() { System.out.println("validate"); String name = "--tab_file"; String value = "test.csv|COMMA#test"; TabFileParameter instance = new TabFileParameter(); instance.validate(name, value); }