docs: public void addTaskHook(ITaskHook newHook) {
      Collection<org.apache.heron.api.hooks.ITaskHook> hooks = delegate.getHooks();
      if (hooks == null) {
        ITaskHookDelegate delegateHook = new ITaskHookDelegate();
        delegateHook.addHook(newHook);
  
        delegate.addTaskHook(delegateHook);
      } else {
        for (org.apache.heron.api.hooks.ITaskHook hook : hooks) {
          if (hook instanceof ITaskHookDelegate) {
            ITaskHookDelegate delegateHook = (ITaskHookDelegate) hook;
            delegateHook.addHook(newHook);
            return;
          }
        }
        throw new RuntimeException("StormCompat taskHooks not setup properly");
      }
    }