class MimeMessageBodyGenerator {

    public MimeMessage from(MimeMessage messageHoldingHeaders, Optional<String> plainText, Optional<String> htmlText) throws MessagingException {
        Preconditions.checkNotNull(messageHoldingHeaders);
        Preconditions.checkNotNull(plainText);
        Preconditions.checkNotNull(htmlText);
        if (htmlText.isPresent()) {
            messageHoldingHeaders.setContent(generateMultipart(htmlText.get(), plainText));
        } else {
            messageHoldingHeaders.setText(plainText.orElse(EMPTY_TEXT));
        }
        return messageHoldingHeaders;
    }

    @Inject @VisibleForTesting  MimeMessageBodyGenerator(HtmlTextExtractor htmlTextExtractor);

}