public static @Nullable String tryConvertNumericLiteral(@NotNull PsiLiteralExpression literal, PsiType wantedType) {
    PsiType exprType = literal.getType();
    if (PsiTypes.intType().equals(exprType)) {
      if (PsiTypes.longType().equals(wantedType)) {
        return literal.getText() + "L";
      }
      if (PsiTypes.floatType().equals(wantedType)) {
        String text = literal.getText();
        if (!text.startsWith("0")) {
          return text + "F";
        }
      }
      if (PsiTypes.doubleType().equals(wantedType)) {
        String text = literal.getText();
        if (!text.startsWith("0")) {
          return text + ".0";
        }
      }
    }
    if (PsiTypes.longType().equals(exprType) && PsiTypes.intType().equals(wantedType)) {
      Long value = ObjectUtils.tryCast(literal.getValue(), Long.class);
      if (value != null && value >= Integer.MIN_VALUE && value <= Integer.MAX_VALUE) {
        String text = literal.getText();
        if (StringUtil.endsWithIgnoreCase(text, "L")) {
          return text.substring(0, text.length() - 1);
        }
      }
    }
    if (PsiTypes.doubleType().equals(exprType) && PsiTypes.floatType().equals(wantedType)) {
      Double value = ObjectUtils.tryCast(literal.getValue(), Double.class);
      if (value != null) {
        float f = (float)(double)value;
        if (Float.isFinite(f) && (f != 0.0 || value == 0.0)) {
          String text = literal.getText();
          if (StringUtil.endsWithIgnoreCase(text, "D")) {
            text = text.substring(0, text.length() - 1);
          }
          return text + "F";
        }
      }
    }
    if (PsiTypes.floatType().equals(exprType) && PsiTypes.doubleType().equals(wantedType)) {
      String text = literal.getText();
      if (StringUtil.endsWithIgnoreCase(text, "F")) {
        String newLiteral = text.substring(0, text.length() - 1);
        if (!StringUtil.containsAnyChar(newLiteral, ".eEpP")) {
          newLiteral += ".0";
        }
        return newLiteral;
      }
    }
    return null;
  }
public static @Nullable String tryConvertNumericLiteral(@NotNull PsiLiteralExpression literal, PsiType wantedType)