boolean (@NotNull JUnitConfiguration 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; } JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(context.getProject()); GlobalSearchScope resolveScope = element.getResolveScope(); if (psiFacade.findClass(JUnitUtil.TEST_CASE_CLASS, resolveScope) == null && psiFacade.findClass(JUnitUtil.TEST5_ANNOTATION, resolveScope) == null) { return false; } sourceElement.set(element); final JUnitConfiguration.Data data = configuration.getPersistentData(); data.setPatterns(classes); data.TEST_OBJECT = JUnitConfiguration.TEST_PATTERN; data.setScope(setupPackageConfiguration(context, configuration, data.getScope())); configuration.setGeneratedName(); final Location contextLocation = context.getLocation(); if (contextLocation instanceof PsiMemberParameterizedLocation) { final String paramSetName = ((PsiMemberParameterizedLocation)contextLocation).getParamSetName(); if (paramSetName != null) { configuration.setProgramParameters(paramSetName); } } return true; }