@Test public void fullNameValidator_returnsFalseWhenAnyNameNotSet(){ Person john = new Person("John", null, "Adams"); assertFalse(fullNameValidator.validate(john)); john = new Person(null, "Quincy", "Adams"); assertFalse(fullNameValidator.validate(john)); john = new Person("John", "Quincy", null); assertFalse(fullNameValidator.validate(john)); }
@Override public boolean validate(Person person) { return person.getFirstName() != null && person.getMiddleName() != null && person.getLastName() != null; }
FullNameValidator implements PersonValidator { @Override public boolean validate(Person person) { return person.getFirstName() != null && person.getMiddleName() != null && person.getLastName() != null; } }
FullNameValidator implements PersonValidator { @Override public boolean validate(Person person) { return person.getFirstName() != null && person.getMiddleName() != null && person.getLastName() != null; }  }
FullNameValidator implements PersonValidator { @Override public boolean validate(Person person) { return person.getFirstName() != null && person.getMiddleName() != null && person.getLastName() != null; }  @Override boolean validate(Person person); }
FullNameValidator implements PersonValidator { @Override public boolean validate(Person person) { return person.getFirstName() != null && person.getMiddleName() != null && person.getLastName() != null; }  @Override boolean validate(Person person);  }