@Test
public void testReadWithNonRootLevelTOC() {

    
    // If the tox.ncx file is not in the root, the hrefs it refers to need to preserve its path.
    Book book = new Book();
    Resource ncxResource = new Resource(ncxData, "xhtml/toc.ncx");
    Resource chapterResource = new Resource("id1", "Hello, world !".getBytes(), "xhtml/chapter1.html", MediatypeService.XHTML);
    book.addResource(chapterResource);
    book.getSpine().addResource(chapterResource);

    book.setNcxResource(ncxResource);
    book.getSpine().setTocResource(ncxResource);

    NCXDocument.read(book, new EpubReader());
    assertEquals("xhtml/chapter1.html", book.getTableOfContents().getTocReferences().get(0).getCompleteHref());
}