@Test
 public void testSetActionClass() {
   Action action =
       ActionBuilder.newInstance()
           .setName("testAction")
           .setHref("/some/path")
           .setComponentClass("someClassName")
           .build();
   System.out.println(action.toString());
 }
  @Override
  public void onRead(SelectionKey key) throws Exception {
    channel = (SocketChannel) key.channel();
    if (cursor == null) {
      if (key.attachment() instanceof Object[]) {
        Object[] ar = (Object[]) key.attachment();
        for (Object o : ar) {
          if (o instanceof ByteBuffer) {
            cursor = (ByteBuffer) o;
            continue;
          }
          if (o instanceof Rfc822HeaderState) {
            req = ((Rfc822HeaderState) o).$req();
            continue;
          }
        }
      }
      key.attach(this);
    }
    cursor =
        null == cursor
            ? ByteBuffer.allocateDirect(getReceiveBufferSize())
            : cursor.hasRemaining()
                ? cursor
                : ByteBuffer.allocateDirect(cursor.capacity() << 1)
                    .put((ByteBuffer) cursor.rewind());
    int read = channel.read(cursor);
    if (read == -1) key.cancel();
    Buffer flip = cursor.duplicate().flip();
    req = (HttpRequest) ActionBuilder.get().state().$req().apply((ByteBuffer) flip);
    if (!BlobAntiPatternObject.suffixMatchChunks(HEADER_TERMINATOR, req.headerBuf())) {
      return;
    }
    cursor = ((ByteBuffer) flip).slice();
    /*  int remaining = Integer.parseInt(req.headerString(HttpHeaders.Content$2dLength));
    final Impl prev = this;
    if (cursor.remaining() != remaining) key.attach(new Impl() {
      @Override
      public void onRead(SelectionKey key) throws Exception {
        int read1 = channel.read(cursor);
        if (read1 == -1)
          key.cancel();
        if (!cursor.hasRemaining()) {
          key.interestOps(SelectionKey.OP_WRITE).attach(prev);
          return;
        }
      }

    });*/
    key.interestOps(SelectionKey.OP_WRITE);
  }
  @Test
  public void testSettingOptionalFieldNull() throws Exception {
    ActionBuilder builder = ActionBuilder.newInstance();

    Action result = builder.setName("testAction").setHref("/some/path").setTitle(null).build();
  }
  @Test
  public void testBuild() throws Exception {
    ActionBuilder builder = ActionBuilder.newInstance();

    Action result = builder.setName("testAction").setHref("/some/path").build();
  }