public int indexOf(PDPage page)
    {
        SearchContext context = new SearchContext(page);
        if (findPage(context, root))
        {
            return context.index;
        }
        return -1;
    }
@Test
    void positiveSingleLevel() throws IOException
    {
        doc = Loader.loadPDF(RandomAccessReadBuffer.createBufferFromStream(
                TestPDPageTree.class.getResourceAsStream("with_outline.pdf")));
        for (int i = 0; i < doc.getNumberOfPages(); i++)
        {
            assertEquals(i, doc.getPages().indexOf(doc.getPage(i)));
        }
    }