class XrefEntries
{
    public static final String PATH = "CRT";

    private final List<Entry<COSObjectKey, Long>> entries;
    private final COSDocument document;
    
    public XrefEntries(PDDocument document)
    {
        Map<COSObjectKey, Long> xrefTable = document.getDocument().getXrefTable();
        entries = xrefTable.entrySet().stream()
                .sorted(Comparator.comparingLong(e -> e.getKey().getNumber()))
                .collect(Collectors.toList());
        this.document = document.getDocument();
    }
    
    public int getXrefEntryCount()
    {
        return entries.size();
    }
    
    public XrefEntry getXrefEntry(int index)
    {<FILL_FUNCTION_BODY>}

    public int indexOf(XrefEntry xrefEntry)
    {
        COSObjectKey key = xrefEntry.getKey();
        Entry<COSObjectKey, Long> entry = entries.stream().filter(e -> key.equals(e.getKey()))
                .findFirst().orElse(null);
        return entry != null ? entries.indexOf(entry) : 0;
    }

    @Override
    public String toString()
    {
        return PATH;
    }

}

        Entry<COSObjectKey, Long> entry = entries.get(index);
        COSObject objectFromPool = document.getObjectFromPool(entry.getKey());
        return new XrefEntry(index, entry.getKey(), entry.getValue(), objectFromPool);
    
<no_super_class>