public static @Nullable PsiMethod getChainedConstructor(PsiMethod constructor) {
    final PsiCodeBlock constructorBody = constructor.getBody();
    if (constructorBody == null) return null;
    final PsiStatement[] statements = constructorBody.getStatements();
    if (statements.length == 1 && statements[0] instanceof PsiExpressionStatement) {
      final PsiExpression expression = ((PsiExpressionStatement)statements[0]).getExpression();
      if (expression instanceof PsiMethodCallExpression call) {
        final PsiReferenceExpression methodExpr = call.getMethodExpression();
        if ("this".equals(methodExpr.getReferenceName())) {
          return call.resolveMethod();
        }
      }
    }
    return null;
  }
public static @Nullable PsiMethod getChainedConstructor(PsiMethod constructor)