@Test
public void testEnglishText() throws Exception {

    String text =
            "Hello, World! This is simple UTF-8 text content written"
                    + " in English to test autodetection of both the character"
                    + " encoding and the language of the input stream.";
    Metadata metadata = new Metadata();
    StringWriter writer = new StringWriter();
    parser.parse(
            new ByteArrayInputStream(text.getBytes(ISO_8859_1)),
            new WriteOutContentHandler(writer),
            metadata,
            new ParseContext());
    String content = writer.toString();
    assertEquals("text/plain; charset=ISO-8859-1", metadata.get(Metadata.CONTENT_TYPE));
    // TIKA-501: Remove language detection from TXTParser
    assertNull(metadata.get(Metadata.CONTENT_LANGUAGE));
    assertNull(metadata.get(TikaCoreProperties.LANGUAGE));
    TikaTest.assertContains("Hello", content);
    TikaTest.assertContains("World", content);
    TikaTest.assertContains("autodetection", content);
    TikaTest.assertContains("stream", content);
}