### Question:
TextMimeBodyPartFactory extends AbstractMimeBodyPartFactory<String> { @Override public MimeBodyPart create(String content, Map<String, Object> parameters) throws MessagingException { MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setContent(content, TEXT_PLAIN_CONTENT_TYPE); bodyPart.setHeader("Content-Type", getMimetype(parameters)); addHeaders(bodyPart, parameters); return bodyPart; }  @Override MimeBodyPart create(String content, Map<String, Object> parameters);  }### Answer:
@Test public void createWithoutMimeTypePassed() throws Exception { MimeBodyPart bodyPart = this.mocker.getComponentUnderTest().create("Lorem ipsum", Collections.<String, Object>emptyMap()); assertEquals("Lorem ipsum", bodyPart.getContent()); assertEquals("text/plain; charset=UTF-8", bodyPart.getContentType()); }
@Test public void createWithMimeTypePassedAndWithHeaders() throws Exception { Map<String, Object> parameters = new HashMap<>(); parameters.put("headers", Collections.singletonMap("Content-Transfer-Encoding", "quoted-printable")); parameters.put("mimetype", "text/calendar"); MimeBodyPart bodyPart = this.mocker.getComponentUnderTest().create("Lorem ipsum", parameters); assertEquals("Lorem ipsum", bodyPart.getContent()); assertEquals("text/calendar", bodyPart.getContentType()); assertArrayEquals(new String[]{ "quoted-printable" }, bodyPart.getHeader("Content-Transfer-Encoding")); }