@Test
public void testI18NHeaders() {

    Metadata metadata = new Metadata();
    InputStream stream = getStream("test-documents/testRFC822_i18nheaders");
    ContentHandler handler = mock(DefaultHandler.class);
    try {
        EXTRACT_ALL_ALTERNATIVES_PARSER.parse(stream, handler, metadata, new ParseContext());
        //tests correct decoding of internationalized headers, both
        //quoted-printable (Q) and Base64 (B).
        assertEquals("Keld J\u00F8rn Simonsen <keld@dkuug.dk>",
                metadata.get(TikaCoreProperties.CREATOR));
        assertEquals("If you can read this you understand the example.",
                metadata.get(TikaCoreProperties.TITLE));
        assertEquals("If you can read this you understand the example.",
                metadata.get(TikaCoreProperties.SUBJECT));
    } catch (Exception e) {
        fail("Exception thrown: " + e.getMessage());
    }
}