### Question:
TemplatedEmailMessageBuilder { public TemplatedEmailMessage build() { return new ImmutableTemplatedEmailMessage( from, to, templateId, subject, variables, locale, fileAttachments); } TemplatedEmailMessageBuilder(final String from,
                                        final String to,
                                        final String templateId,
                                        final Map<String, ?> variables,
                                        final Set<SpiEmailNotificationFileAttachment> fileAttachments); TemplatedEmailMessageBuilder withLocale(final Locale locale); TemplatedEmailMessageBuilder withSubject(final String subject); TemplatedEmailMessage build();  }### Answer:
@Test public void build() { final String from = uuid(); final String to = uuid(); final String subject = uuid(); final String templateId = uuid(); final Map<String, String> variables = Collections.singletonMap(uuid(), uuid()); final Locale locale = Locale.forLanguageTag("hy"); assertThat(new TemplatedEmailMessageBuilder( from, to, templateId, variables, Collections.emptySet() ) .withSubject(subject) .withLocale(locale).build()) .hasFieldOrPropertyWithValue("from", from) .hasFieldOrPropertyWithValue("to", to) .hasFieldOrPropertyWithValue("subject", subject) .hasFieldOrPropertyWithValue("templateId", templateId) .hasFieldOrPropertyWithValue("locale", locale) .hasFieldOrPropertyWithValue("variables", variables); }