void clearDocumentReferences(@NotNull Document document) {
    myDocumentsWithStacks.remove(document);
    // DocumentReference created from file is not equal to ref created from document from that file, so have to check for leaking both
    DocumentReference referenceFile = DocumentReferenceManager.getInstance().create(document);
    DocumentReference referenceDoc = new DocumentReferenceByDocument(document);
    myDocumentStacks.remove(referenceFile);
    myDocumentStacks.remove(referenceDoc);
  }
void clearDocumentReferences(@NotNull Document document)