boolean (RunConfiguration runConfiguration, Location location) { TestNGConfiguration config = (TestNGConfiguration)runConfiguration; TestData testObject = config.getPersistantData(); if (testObject == null) { return false; } final PsiElement element = location.getPsiElement(); final TestNGTestObject testNGTestObject = TestNGTestObject.fromConfig(config); if (testNGTestObject.isConfiguredByElement(element)) { final Module configurationModule = config.getConfigurationModule().getModule(); if (Comparing.equal(location.getModule(), configurationModule)) return true; final Module predefinedModule = ((TestNGConfiguration)RunManager.getInstance(location.getProject()).getConfigurationTemplate(getConfigurationFactories()[0]) .getConfiguration()).getConfigurationModule().getModule(); return Comparing.equal(predefinedModule, configurationModule); } else { return false; } }