MimeMessageWrapper extends MimeMessage implements Disposable { public synchronized boolean isModified() { return headersModified || bodyModified || modified; } private  MimeMessageWrapper(Session session);  MimeMessageWrapper(Session session, MimeMessageSource source);  MimeMessageWrapper(MimeMessageSource source);  MimeMessageWrapper(MimeMessage original); synchronized String getSourceId(); synchronized void loadMessage(); synchronized boolean isModified(); synchronized boolean isBodyModified(); synchronized boolean isHeaderModified(); @Override void writeTo(OutputStream os); @Override void writeTo(OutputStream os, String[] ignoreList); void writeTo(OutputStream headerOs, OutputStream bodyOs); void writeTo(OutputStream headerOs, OutputStream bodyOs, String[] ignoreList); synchronized void writeTo(OutputStream headerOs, OutputStream bodyOs, String[] ignoreList, boolean preLoad); @Override synchronized int getSize(); @Override int getLineCount(); long getMessageSize(); @Override String[] getHeader(String name); @Override String getHeader(String name, String delimiter); @Override Enumeration<Header> getAllHeaders(); @Override Enumeration<Header> getMatchingHeaders(String[] names); @Override Enumeration<Header> getNonMatchingHeaders(String[] names); @Override Enumeration<String> getAllHeaderLines(); @Override Enumeration<String> getMatchingHeaderLines(String[] names); @Override Enumeration<String> getNonMatchingHeaderLines(String[] names); @Override void setHeader(String name, String value); @Override void addHeader(String name, String value); @Override void removeHeader(String name); @Override void addHeaderLine(String line); @Override synchronized void setDataHandler(DataHandler arg0); @Override void dispose(); @Override synchronized InputStream getRawInputStream(); synchronized InputStream getMessageInputStream(); static final String USE_MEMORY_COPY; }
@Test public void testDeferredMessageLoading() throws MessagingException, IOException { assertThat(mw.getSubject()).isEqualTo("foo"); assertThat(mw.messageParsed()).isFalse(); assertThat(mw.getContent()).isEqualTo("bar\r\n"); assertThat(mw.messageParsed()).isTrue(); assertThat(mw.isModified()).isFalse(); }