public void testGetUncommittedDocuments_documentChanged_DontProcessEvents() throws Exception {
    PsiFile file = getPsiManager().findFile(createFile());

    final Document document = getPsiDocumentManager().getDocument(file);

    final TextBlock block = TextBlock.get(file);
    ApplicationManager.getApplication()
        .runWriteAction(
            new Runnable() {
              public void run() {
                block.performAtomically(
                    new Runnable() {
                      @Override
                      public void run() {
                        getPsiDocumentManager()
                            .documentChanged(
                                new DocumentEventImpl(
                                    document, 0, "", "", document.getModificationStamp(), false));
                      }
                    });
              }
            });

    assertEquals(0, getPsiDocumentManager().getUncommittedDocuments().length);
  }