@Test public void givenBeanWithValidDomain_shouldValidate() { RepeatedConstraint repeatedConstraint = new RepeatedConstraint(); repeatedConstraint.setText("www.readlearncode.com"); Set<ConstraintViolation<RepeatedConstraint>> constraintViolations = validator.validate(repeatedConstraint); assertThat(constraintViolations.size()).isEqualTo(0); }
public void setText(String text) { this.text = text; }
RepeatedConstraint { public void setText(String text) { this.text = text; } }
RepeatedConstraint { public void setText(String text) { this.text = text; }  }
RepeatedConstraint { public void setText(String text) { this.text = text; }  String getText(); void setText(String text); }
RepeatedConstraint { public void setText(String text) { this.text = text; }  String getText(); void setText(String text);  }