class Driver {

    public static DriverBuilder builder() {
        return new DriverBuilder();
    }

}

class DriverTest {

    private static Validator validator;
    private CurrencyUnit usd;
    private Car ferrari;

    @Test
    public void shouldReturnErrorWhenDriverEmailIsInvalid() {


        Driver driver = Driver.builder().withAge(25)
                .withCars(Arrays.asList(ferrari))
                .withEmail("emailemail")
                .withLicense(true)
                .withName("Speed Racer").build();

        Set<ConstraintViolation<Driver>> validate = validator.validate(driver);
        assertFalse(validate.isEmpty());
        String message = validate.stream().findFirst()
                .map(ConstraintViolation::getMessageTemplate)
                .orElse(null);
        assertEquals("Email should be valid", message);
    }

}