code: public EnumConstant constant(int tag) {
      for (EnumConstant constant : constants()) {
        if (constant.tag() == tag) {
          return constant;
        }
      }
      return null;
    }
docs: Returns the constant tagged {@code tag}, or null if this enum has no such constant.