private void fixVariableType(@NotNull Project project, PsiVariable myVariable) {
    myVariable.normalizeDeclaration();
    Objects.requireNonNull(myVariable.getTypeElement()).replace(JavaPsiFacade.getElementFactory(project).createTypeElement(myTargetType));
    JavaCodeStyleManager.getInstance(project).shortenClassReferences(myVariable);
  }
private void fixVariableType(@NotNull Project project, PsiVariable myVariable)