@Test public void buildInvalidAllowedShouldWork() { String name = "bob"; String address = "me@apache.org"; Emailer expected = new Emailer(Optional.of(name), Optional.of(address)); Emailer actual = Emailer.builder() .name(name) .email(address) .allowInvalid() .build(); assertThat(actual).isEqualToComparingFieldByField(expected); }
public static Builder builder() { return new Builder(); }
Emailer { public static Builder builder() { return new Builder(); } }
Emailer { public static Builder builder() { return new Builder(); } @VisibleForTesting  Emailer(Optional<String> name, Optional<String> email); }
Emailer { public static Builder builder() { return new Builder(); } @VisibleForTesting  Emailer(Optional<String> name, Optional<String> email); static List<Emailer> fromAddressList(AddressList list); static Optional<Emailer> firstFromMailboxList(MailboxList list); static Builder builder(); Optional<String> getName(); Optional<String> getEmail(); @JsonIgnore MailAddress toMailAddress(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Emailer { public static Builder builder() { return new Builder(); } @VisibleForTesting  Emailer(Optional<String> name, Optional<String> email); static List<Emailer> fromAddressList(AddressList list); static Optional<Emailer> firstFromMailboxList(MailboxList list); static Builder builder(); Optional<String> getName(); Optional<String> getEmail(); @JsonIgnore MailAddress toMailAddress(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }