boolean (@NotNull T configuration, @NotNull ConfigurationContext context) { if (isMultipleElementsSelected(context)) { return false; } if (!isApplicableTestType(configuration.getTestType(), context)) return false; final RunConfiguration predefinedConfiguration = context.getOriginalConfiguration(getConfigurationType()); RunnerAndConfigurationSettings template = context.getRunManager().getConfigurationTemplate(getConfigurationFactory()); T templateConfiguration = (T)template.getConfiguration(); final Module predefinedModule = templateConfiguration.getConfigurationModule().getModule(); final String vmParameters; if (predefinedConfiguration != null) { vmParameters = predefinedConfiguration instanceof CommonJavaRunConfigurationParameters ? ((CommonJavaRunConfigurationParameters)predefinedConfiguration).getVMParameters() : null; } else { vmParameters = templateConfiguration.getVMParameters(); } if (!Comparing.strEqual(vmParameters, configuration.getVMParameters())) return false; final Location contextLocation = context.getLocation(); if (contextLocation == null) { return false; } if (differentParamSet(configuration, contextLocation)) return false; Location location = JavaExecutionUtil.stepIntoSingleClass(contextLocation); if (location == null) { return false; } if (isConfiguredByElement(configuration, context, location.getPsiElement())) { final Module configurationModule = configuration.getConfigurationModule().getModule(); final Module locationModule = location.getModule(); if (Comparing.equal(locationModule, configurationModule)) return true; if ((predefinedModule != null || locationModule == null) && Comparing.equal(predefinedModule, configurationModule)) return true; } return false; }