@Test
public void testQuotedPrintable() {

    Metadata metadata = new Metadata();
    InputStream stream = getStream("test-documents/testRFC822_quoted");
    ContentHandler handler = new BodyContentHandler();
    ParseContext context = new ParseContext();
    try {
        EXTRACT_ALL_ALTERNATIVES_PARSER.parse(stream, handler, metadata, context);
        //tests correct decoding of quoted printable text, including UTF-8 bytes into Unicode
        String bodyText = handler.toString();
        assertTrue(bodyText.contains("D\u00FCsseldorf has non-ascii."));
        assertTrue(bodyText.contains("Lines can be split like this."));
        assertTrue(bodyText.contains("Spaces at the end of a line \r\nmust be encoded.\r\n"));
        assertFalse(bodyText.contains("=")); //there should be no escape sequences
    } catch (Exception e) {
        fail("Exception thrown: " + e.getMessage());
    }
}