boolean (@NotNull TestNGConfiguration configuration, @NotNull ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement) { final LinkedHashSet<String> classes = new LinkedHashSet<>(); final PsiElement element = checkPatterns(context, classes); if (element == null) { return false; } if (JavaPsiFacade.getInstance(context.getProject()) .findClass(TestNGUtil.TEST_ANNOTATION_FQN, element.getResolveScope()) == null) { return false; } sourceElement.set(element); final TestData data = configuration.getPersistantData(); data.setPatterns(classes); data.TEST_OBJECT = TestType.PATTERN.getType(); data.setScope(setupPackageConfiguration(context, configuration, data.getScope())); configuration.setGeneratedName(); setupConfigurationParamName(configuration, context.getLocation()); return true; }