boolean (@NotNull PsiCall call) { if (!(call instanceof PsiNewExpression newExpression)) { return false; } PsiImmediateClassType targetType = ObjectUtils.tryCast(newExpression.getType(), PsiImmediateClassType.class); if (targetType == null) return false; return targetType.resolve() instanceof PsiAnonymousClass; }