code: protected IdleStateEvent newIdleStateEvent(IdleState state, boolean first) {
          switch (state) {
              case ALL_IDLE:
                  return first ? IdleStateEvent.FIRST_ALL_IDLE_STATE_EVENT : IdleStateEvent.ALL_IDLE_STATE_EVENT;
              case READER_IDLE:
                  return first ? IdleStateEvent.FIRST_READER_IDLE_STATE_EVENT : IdleStateEvent.READER_IDLE_STATE_EVENT;
              case WRITER_IDLE:
                  return first ? IdleStateEvent.FIRST_WRITER_IDLE_STATE_EVENT : IdleStateEvent.WRITER_IDLE_STATE_EVENT;
              default:
                  throw new IllegalArgumentException("Unhandled: state=" + state + ", first=" + first);
          }
      }
docs: Returns a {@link IdleStateEvent}.