@Test public void wrap() throws Exception { ExtendedMimeMessage extendedMimeMessage = new ExtendedMimeMessage(); assertThat(ExtendedMimeMessage.wrap(extendedMimeMessage), sameInstance(extendedMimeMessage)); MimeMessage mimeMessage = new MimeMessage((Session) null); mimeMessage.setText(TEST_CONTENT); assertThat(ExtendedMimeMessage.wrap(mimeMessage).getContent(), equalTo(TEST_CONTENT)); }
public static ExtendedMimeMessage wrap(MimeMessage message) { if (message instanceof ExtendedMimeMessage) { return (ExtendedMimeMessage) message; } else { try { return new ExtendedMimeMessage(message); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while wrapping a MimeMessage into an extended one", e); } } }
ExtendedMimeMessage extends MimeMessage { public static ExtendedMimeMessage wrap(MimeMessage message) { if (message instanceof ExtendedMimeMessage) { return (ExtendedMimeMessage) message; } else { try { return new ExtendedMimeMessage(message); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while wrapping a MimeMessage into an extended one", e); } } } }
ExtendedMimeMessage extends MimeMessage { public static ExtendedMimeMessage wrap(MimeMessage message) { if (message instanceof ExtendedMimeMessage) { return (ExtendedMimeMessage) message; } else { try { return new ExtendedMimeMessage(message); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while wrapping a MimeMessage into an extended one", e); } } } ExtendedMimeMessage();  ExtendedMimeMessage(Session session, InputStream is);  ExtendedMimeMessage(MimeMessage source); }
ExtendedMimeMessage extends MimeMessage { public static ExtendedMimeMessage wrap(MimeMessage message) { if (message instanceof ExtendedMimeMessage) { return (ExtendedMimeMessage) message; } else { try { return new ExtendedMimeMessage(message); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while wrapping a MimeMessage into an extended one", e); } } } ExtendedMimeMessage();  ExtendedMimeMessage(Session session, InputStream is);  ExtendedMimeMessage(MimeMessage source); static ExtendedMimeMessage wrap(MimeMessage message); boolean isEmpty(); void setType(String mailType); String getType(); void setMessageId(String messageId); boolean ensureSaved(); @Override void setHeader(String name, String value); String getUniqueMessageId(); }
ExtendedMimeMessage extends MimeMessage { public static ExtendedMimeMessage wrap(MimeMessage message) { if (message instanceof ExtendedMimeMessage) { return (ExtendedMimeMessage) message; } else { try { return new ExtendedMimeMessage(message); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while wrapping a MimeMessage into an extended one", e); } } } ExtendedMimeMessage();  ExtendedMimeMessage(Session session, InputStream is);  ExtendedMimeMessage(MimeMessage source); static ExtendedMimeMessage wrap(MimeMessage message); boolean isEmpty(); void setType(String mailType); String getType(); void setMessageId(String messageId); boolean ensureSaved(); @Override void setHeader(String name, String value); String getUniqueMessageId();  }