code: @SuppressWarnings("unchecked")
    private static Method getMethodOrDie(
        final Class clazz, final String name, final Class... params) {
      try {
        return clazz.getMethod(name, params);
      } catch (NoSuchMethodException e) {
        throw new RuntimeException(
          "Generated message class \"" + clazz.getName() +
          "\" missing method \"" + name + "\".", e);
      }
    }
docs: Calls Class.getMethod and throws a RuntimeException if it fails.