@Test
public void testWarnsOfStrayTags() throws Exception {

    final URI uri = this.getClass().getResource(INDEX_ALL_BAD_TAG_HTML).toURI();
    final List<File> filesToIndex = Collections.singletonList(new File(uri));
    final ByteArrayOutputStream errStream = new ByteArrayOutputStream();
    System.setErr(new PrintStream(errStream));
    try {
        JavadocSupport.findSearchIndexValues(filesToIndex);
    }
    finally {
        System.setErr(null);
    }
    final String err = errStream.toString();
    assertThat(err, containsString("Something went wrong with parsing a link, possibly unescaped tags" +
                                   " in Javadoc. (Name: , Type: CONSTRUCTOR, Link: )"));
    assertThat(err, containsString("Most recently parsed value was: (Name: SampleClass, Type: CLASS,"
                                   + " Path: ./com/megatome/j2d/sample/clazz/SampleClass.html)"));
}