### Question:
UserValidator { public Validation<Seq<String>, User> validateUser(String name, String email) { return Validation .combine(validateField(name, NAME_PATTERN, NAME_ERROR) ,validateField(email, EMAIL_PATTERN, EMAIL_ERROR)) .ap(User::new); }  Validation<Seq<String>, User> validateUser(String name, String email);  }### Answer:
@Test public void givenValidUserParams_whenValidated_thenInstanceOfValid() { UserValidator userValidator = new UserValidator(); assertThat(userValidator.validateUser("John", "john@domain.com"), instanceOf(Valid.class)); }
@Test public void givenInvalidUserParams_whenValidated_thenInstanceOfInvalid() { UserValidator userValidator = new UserValidator(); assertThat(userValidator.validateUser("John", "no-email"), instanceOf(Invalid.class)); }