@Test
public void testFirstTitleValueisSetToMetadata() throws Exception {

    String test = "<html><title>Simple Content</title><body><h1></h1>"
            + "<title>TitleToIgnore</title></body></html>";
    Metadata metadata = new Metadata();
    new HtmlParser().parse(
            new ByteArrayInputStream(test.getBytes(UTF_8)),
            new BodyContentHandler(), metadata, new ParseContext());
    //Expecting first title to be set in meta data and second one to be ignored.
    assertEquals("Simple Content", metadata.get(TikaCoreProperties.TITLE));
}