protected Document createDocument() {
    Project project = getProjectIfValid();
    final PsiFileFactory factory = PsiFileFactory.getInstance(project);
    final long stamp = LocalTimeCounter.currentTime();
    if (myFileType == null) {
      LOG.error("Provide not-null FileType");
      myFileType = FileTypes.PLAIN_TEXT;
    }
    final PsiFile psiFile = factory.createFileFromText("Dummy." + myFileType.getDefaultExtension(), myFileType, "", stamp, true, false);
    return PsiDocumentManager.getInstance(project).getDocument(psiFile);
  }
protected Document createDocument()