code: @SuppressWarnings("unchecked")
      protected final void initSession(IoSession session,
              IoFuture future, IoSessionInitializer sessionInitializer) {
          // Update lastIoTime if needed.
          if (stats.getLastReadTime() == 0) {
              stats.setLastReadTime(getActivationTime());
          }
          
          if (stats.getLastWriteTime() == 0) {
              stats.setLastWriteTime(getActivationTime());
          }
  
          // Every property but attributeMap should be set now.
          // Now initialize the attributeMap.  The reason why we initialize
          // the attributeMap at last is to make sure all session properties
          // such as remoteAddress are provided to IoSessionDataStructureFactory.
          try {
              ((AbstractIoSession) session).setAttributeMap(session.getService()
                      .getSessionDataStructureFactory().getAttributeMap(session));
          } catch (IoSessionInitializationException e) {
              throw e;
          } catch (Exception e) {
              throw new IoSessionInitializationException(
                      "Failed to initialize an attributeMap.", e);
          }
  
          try {
              ((AbstractIoSession) session).setWriteRequestQueue(session
                      .getService().getSessionDataStructureFactory()
                      .getWriteRequestQueue(session));
          } catch (IoSessionInitializationException e) {
              throw e;
          } catch (Exception e) {
              throw new IoSessionInitializationException(
                      "Failed to initialize a writeRequestQueue.", e);
          }
  
          if ((future != null) && (future instanceof ConnectFuture)) {
              // DefaultIoFilterChain will notify the future. (We support ConnectFuture only for now).
              session.setAttribute(DefaultIoFilterChain.SESSION_CREATED_FUTURE,
                      future);
          }
  
          if (sessionInitializer != null) {
              sessionInitializer.initializeSession(session, future);
          }
  
          finishSessionInitialization0(session, future);
      }
docs: TODO Figure out make it work without causing a compiler error / warning.