private boolean configure(
      TestNGConfiguration configuration,
      Location location,
      ConfigurationContext context,
      Project project,
      @Nullable PsiClass delegate,
      @Nullable PsiMethod method) {
    if (delegate == null) {
      return false;
    }

    setupConfigurationModule(context, configuration);
    Module originalModule = configuration.getConfigurationModule().getModule();
    configuration.setClassConfiguration(delegate);
    if (method != null) {
      configuration.setMethodConfiguration(PsiLocation.fromPsiElement(project, method));
    }
    configuration.restoreOriginalModule(originalModule);
    configuration.setName(configuration.getName());
    JavaRunConfigurationExtensionManager.getInstance()
        .extendCreatedConfiguration(configuration, location);
    return true;
  }
 public void elementRenamedOrMoved(@NotNull final PsiElement newElement) {
   data.setTestMethod(PsiLocation.fromPsiElement((PsiMethod) newElement));
 }