@Test public void to_domain_should_return_domain_object() throws Exception { EmailRequest emailRequest = EmailRequest.builder() .email("email@gmail.com") .body("body") .subject("subject") .isHTML(true) .build(); Email email = emailRequest.toDomain(); assertThat(email.getToAddress()).isEqualTo("email@gmail.com"); assertThat(email.getSubject()).isEqualTo("subject"); assertThat(email.getBody()).isEqualTo("body"); assertThat(email.isHtml()).isTrue(); }
public Email toDomain() { return Email.builder() .toAddress(email) .subject(subject) .body(body) .html(isHTML) .build(); }
EmailRequest { public Email toDomain() { return Email.builder() .toAddress(email) .subject(subject) .body(body) .html(isHTML) .build(); } }
EmailRequest { public Email toDomain() { return Email.builder() .toAddress(email) .subject(subject) .body(body) .html(isHTML) .build(); }  }
EmailRequest { public Email toDomain() { return Email.builder() .toAddress(email) .subject(subject) .body(body) .html(isHTML) .build(); }  Email toDomain(); }
EmailRequest { public Email toDomain() { return Email.builder() .toAddress(email) .subject(subject) .body(body) .html(isHTML) .build(); }  Email toDomain();  }