@Test
public void testSetDataHandler() throws Exception {

sion s = Session.getInstance(new Properties());
create a message and extract the DataHandler for a part
eMessage orig = createMessage(s);
eMultipart omp = (MimeMultipart)orig.getContent();
eBodyPart obp = (MimeBodyPart)omp.getBodyPart(0);
al DataHandler odh = obp.getDataHandler();
create a new message and use the DataHandler
eMessage msg = new MimeMessage(s);
eMultipart mp = new MimeMultipart();
eBodyPart mbp = new MimeBodyPart() {
dh = odh; }
 };
addBodyPart(mbp);
.setContent(mp);
depend on copy constructor streaming the data
 = new MimeMessage(msg);
= (MimeMultipart)msg.getContent();
 = (MimeBodyPart)mp.getBodyPart(0);
ertEquals("text/x-test", mbp.getContentType());
ertEquals("quoted-printable", mbp.getEncoding());
ertEquals("test part", getString(mbp.getInputStream()));
}