Document (final String s, final Project project) { if (ApplicationManager.getApplication().isUnitTestMode() || project.isDefault()) { return new DocumentImpl(s); } else { return JavaReferenceEditorUtil.createTypeDocument(s, project); } }