code: public static boolean isConstructor(JCTree tree) {
          if (tree.hasTag(METHODDEF)) {
              Name name = ((JCMethodDecl) tree).name;
              return name == name.table.names.init;
          } else {
              return false;
          }
      }
docs: Is tree a constructor declaration?