@Test
public void write_filename_contains_bad_characters() throws TaskException {

    PDDocument doc = new PDDocument();
    PDPage page = new PDPage();
    doc.addPage(page);
    String withBadCharacter = "This is a bad \uF021character";
    FilenameFooterWriter writer = new FilenameFooterWriter(true, doc);
    writer.addFooter(page, withBadCharacter, 1);
    assertPageFooterText(page, "This is a bad #character 1");
}