private static @Nullable PsiClassType getQualifierExpressionType(PsiElement element) {
    if (!(element instanceof PsiMethodCallExpression methodCallExpression)) {
      return null;
    }

    final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression();
    final PsiExpression qualifierExpression = methodExpression.getQualifierExpression();
    final PsiType type = qualifierExpression != null ? qualifierExpression.getType() : null;
    return type instanceof PsiClassType ? (PsiClassType)type : null;
  }
private static @Nullable PsiClassType getQualifierExpressionType(PsiElement element)