private @NotNull Map<String, String> getConversionNewTypeWithGeneric(@NotNull PsiSwitchBlock switchBlock) {
    HashMap<String, String> mapToConvert = new HashMap<>();
    PsiExpression expression = switchBlock.getExpression();
    if (expression == null) {
      return Map.of();
    }
    PsiType expressionType = expression.getType();
    if (!(expressionType instanceof PsiClassType expressionClassType)) {
      return Map.of();
    }
    PsiClassType.ClassResolveResult classResolveResult = expressionClassType.resolveGenerics();
    PsiClass expressionClass = classResolveResult.getElement();
    if (expressionClass == null) {
      return Map.of();
    }

    for (String myName : myNames) {
      Project project = switchBlock.getProject();
      PsiClass classToAdd = JavaPsiFacade.getInstance(project).findClass(myName, switchBlock.getResolveScope());
      if (classToAdd == null) {
        continue;
      }
      if (!classToAdd.hasTypeParameters()) {
        continue;
      }
      if (!InheritanceUtil.isInheritorOrSelf(classToAdd, expressionClass, true)) {
        continue;
      }
      List<PsiType> arguments = GenericsUtil.getExpectedTypeArguments(switchBlock,
                                                                      classToAdd,
                                                                      Arrays.asList(classToAdd.getTypeParameters()),
                                                                      expressionClassType);
      if (ContainerUtil.all(arguments, argument -> argument == null)) {
        continue;
      }
      arguments = ContainerUtil.map(arguments, arg -> arg == null ? PsiWildcardType.createUnbounded(switchBlock.getManager()) : arg);
      PsiClassType classTypeToAdd = PsiElementFactory.getInstance(project).createType(classToAdd, arguments.toArray(PsiType.EMPTY_ARRAY));
      if (TypeConversionUtil.isAssignable(expressionClassType, classTypeToAdd)) {
        mapToConvert.put(myName, classTypeToAdd.getCanonicalText());
      }
    }
    return mapToConvert;
  }
private @NotNull Map<String, String> getConversionNewTypeWithGeneric(@NotNull PsiSwitchBlock switchBlock)