public static @Nullable CreateClassOrPackageFix createFix(final @NotNull String qualifiedName,
                                                            final @NotNull GlobalSearchScope scope,
                                                            final @NotNull PsiElement context,
                                                            final @Nullable PsiPackage basePackage,
                                                            @Nullable ClassKind kind,
                                                            @Nullable String superClass,
                                                            @Nullable String templateName) {
    final List<PsiDirectory> directories = getWritableDirectoryListDefault(basePackage, scope, context.getManager());
    if (directories.isEmpty()) {
      return null;
    }
    final String redPart = basePackage == null ? qualifiedName : qualifiedName.substring(basePackage.getQualifiedName().length() + 1);
    final int dot = redPart.indexOf('.');
    final boolean fixPath = dot >= 0;
    final String firstRedName = fixPath ? redPart.substring(0, dot) : redPart;
    directories.removeIf(directory -> !checkCreateClassOrPackage(kind != null && !fixPath, directory, firstRedName));
    return new CreateClassOrPackageFix(directories,
                                       context,
                                       fixPath ? qualifiedName : redPart,
                                       redPart,
                                       kind,
                                       superClass,
                                       templateName);
  }
public static @Nullable CreateClassOrPackageFix createFix(final @NotNull String qualifiedName,
                                                            final @NotNull GlobalSearchScope scope,
                                                            final @NotNull PsiElement context,
                                                            final @Nullable PsiPackage basePackage,
                                                            @Nullable ClassKind kind,
                                                            @Nullable String superClass,
                                                            @Nullable String templateName)