protected static PsiType getType(PsiExpression expression) {
    if (!(expression instanceof PsiNewExpression newExpression)) {
      return expression.getType();
    }
    final PsiAnonymousClass anonymousClass = newExpression.getAnonymousClass();
    return anonymousClass != null ? anonymousClass.getBaseClassType() : expression.getType();
  }
protected static PsiType getType(PsiExpression expression)