@Test
public void testBuildWithValidator_shouldReturnSameValidator() throws Exception {

    @SuppressWarnings("serial")
    FieldValidator fieldValidator = new FieldValidator() {
        @Override
        public SingleAttributeValidationResult validate(String validate) {
            return null;
        }
    };
    builder.validator(fieldValidator);
    AttributeDefinition build = builder.build();
    Assert.assertSame(fieldValidator, build.getValidator());
}