List<TestDataFile> (@NotNull PsiMethod psiMethod, @Nullable String testDataPath) { Application application = ApplicationManager.getApplication(); if (!application.isUnitTestMode() && application.isHeadlessEnvironment()) { // shouldn't be invoked under these conditions anyway, just for additional safety LOG.warn("Collecting testdata by existing files called in headless environment and not-unit testing mode"); return Collections.emptyList(); } return ReadAction.compute(() -> buildDescriptorFromExistingTestData(psiMethod, testDataPath).restoreFiles()); }