public TreeNodeFactory(IndirectObjectFactory objects) {
   this.objects = objects;
   for (int i = 0; i < objects.size(); i++) {
     int ref = objects.getRefByIndex(i);
     nodes.add(PdfObjectTreeNode.getInstance(PdfNull.PDFNULL, ref));
   }
 }
 public PdfObjectTreeNode getNode(int ref) {
   int idx = objects.getIndexByRef(ref);
   PdfObjectTreeNode node = nodes.get(idx);
   if (node.getPdfObject().isNull()) {
     node = PdfObjectTreeNode.getInstance(objects.loadObjectByReference(ref), ref);
     nodes.set(idx, node);
   }
   return node;
 }