RegexValidator implements Serializable { @Override public String toString() { StringBuilder buffer = new StringBuilder(); buffer.append("RegexValidator{"); for (int i = 0; i < patterns.length; i++) { if (i > 0) { buffer.append(","); } buffer.append(patterns[i].pattern()); } buffer.append("}"); return buffer.toString(); } RegexValidator(String regex);  RegexValidator(String regex, boolean caseSensitive);  RegexValidator(String[] regexs);  RegexValidator(String[] regexs, boolean caseSensitive); boolean isValid(String value); String[] match(String value); String validate(String value); @Override String toString();  }
@Test public void testToString() { RegexValidator regexValid = new RegexValidator("\\a(?>)*"); assertEquals("RegexValidator{\\a(?>)*}", regexValid.toString()); }