@Test
public void testCP866() throws Exception {

    Metadata metadata = new Metadata();
    StringWriter writer = new StringWriter();
    parser.parse(
            TXTParserTest.class.getResourceAsStream("/test-documents/russian.cp866.txt"),
            new WriteOutContentHandler(writer),
            metadata,
            new ParseContext());
    assertEquals("text/plain; charset=IBM866", metadata.get(Metadata.CONTENT_TYPE));
}