code: public Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException
     {
        if (fieldSelector == FieldSelectors.UUID)
        {
           Integer docNum = new Integer(n);
           Document doc;
           String uuid = docNumber2uuid.get(docNum);
           if (uuid == null)
           {
              doc = super.document(n, fieldSelector);
              uuid = doc.get(FieldNames.UUID);
              docNumber2uuid.put(docNum, uuid);
           }
           else
           {
              doc = new Document();
              doc.add(new Field(FieldNames.UUID, uuid.toString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
           }
           return doc;
        }
        else
        {
           return super.document(n, fieldSelector);
        }
     }
docs: Uses the {@link #docNumber2uuid} cache for document lookups that are only
  interested in the {@link FieldSelectors#UUID}.
  
  @param n the document number.
  @param fieldSelector the field selector.
  @return the document.
  @throws CorruptIndexException if the index is corrupt.
  @throws IOException if an error occurs while reading from the index.