private void applyTo(final JUnitConfiguration.Data data, final Module module, @Nullable ClassEditorField classField) {
    final String testObject = getTestObject();
    final String className = getJUnitTextValue(CLASS);
    data.TEST_OBJECT = testObject;
    if (!JUnitConfiguration.TEST_PACKAGE.equals(testObject) &&
        !JUnitConfiguration.TEST_PATTERN.equals(testObject) &&
        !JUnitConfiguration.TEST_DIRECTORY.equals(testObject) &&
        !JUnitConfiguration.TEST_CATEGORY.equals(testObject) &&
        !JUnitConfiguration.BY_SOURCE_CHANGES.equals(testObject)) {
      data.METHOD_NAME = getJUnitTextValue(METHOD);
      if (classField != null) {
        String jvmName = classField.getClassName();
        if (jvmName != null) {
          data.MAIN_CLASS_NAME = jvmName;
          data.PACKAGE_NAME = StringUtil.getPackageName(jvmName);
        }
        else {
          data.MAIN_CLASS_NAME = className;
        }
        return;
      }
      if (!className.equals(replaceRuntimeClassName(data.getMainClassName()))) {
        try {
          final PsiClass testClass;
          if (!myProject.isDefault() && !StringUtil.isEmptyOrSpaces(className)) {
            JavaRunConfigurationModule configurationModule = new JavaRunConfigurationModule(myProject, true);
            configurationModule.setModule(module);
            testClass = configurationModule.findClass(className);
          }
          else {
            testClass = null;
          }
          if (testClass != null && testClass.isValid()) {
            data.setMainClass(testClass);
          }
          else {
            data.MAIN_CLASS_NAME = className;
          }
        }
        catch (ProcessCanceledException | IndexNotReadyException e) {
          data.MAIN_CLASS_NAME = className;
        }
      }
    }
    else if (!JUnitConfiguration.BY_SOURCE_CHANGES.equals(testObject)) {
      switch (testObject) {
        case JUnitConfiguration.TEST_PACKAGE -> data.PACKAGE_NAME = getJUnitTextValue(ALL_IN_PACKAGE);
        case JUnitConfiguration.TEST_DIRECTORY -> data.setDirName(getJUnitTextValue(DIR));
        case JUnitConfiguration.TEST_CATEGORY -> data.setCategoryName(getJUnitTextValue(CATEGORY));
        default -> {
          final LinkedHashSet<String> set = new LinkedHashSet<>();
          final String[] patterns = getJUnitTextValue(PATTERN).split("\\|\\|");
          for (String pattern : patterns) {
            if (!pattern.isEmpty()) {
              set.add(pattern);
            }
          }
          data.setPatterns(set);
        }
      }
      data.MAIN_CLASS_NAME = "";
      data.METHOD_NAME = "";
    }
  }
private void applyTo(final JUnitConfiguration.Data data, final Module module, @Nullable ClassEditorField classField)