### Question:
FetchInstruction { public boolean hasMimePartAddressDefined() { if (mimePart.getAddress() != null) { return true; } return false; } private  FetchInstruction(MimePart mimePart, Integer truncation, MSEmailBodyType bodyType, MailTransformation mailTransformation); static Builder builder(); MimePart getMimePart(); Integer getTruncation(); MSEmailBodyType getBodyType(); MailTransformation getMailTransformation(); boolean hasMimePartAddressDefined(); boolean mustTruncate(); @Override final int hashCode(); @Override final boolean equals(Object object); @Override String toString();  }### Answer:
@Test public void testHasMimePartAddressDefined() { MimePart mimePart = createStrictMock(MimePart.class); expect(mimePart.getAddress()).andReturn(new MimeAddress("address")); replay(mimePart); FetchInstruction fetchInstruction = createFetchInstruction(100, mimePart); assertThat(fetchInstruction.hasMimePartAddressDefined()).isTrue(); verify(mimePart); }
@Test public void testHasNoMimePartAddressDefined() { MimePart mimePart = createStrictMock(MimePart.class); expect(mimePart.getAddress()).andReturn(null); replay(mimePart); FetchInstruction fetchInstruction = createFetchInstruction(100, mimePart); assertThat(fetchInstruction.hasMimePartAddressDefined()).isFalse(); verify(mimePart); }