IncrRequest extends AsciiRequest<Long> { private IncrRequest(final byte[] operation, final byte[] key, final long by) { super(key); this.operation = operation; this.by = by; } private  IncrRequest(final byte[] operation, final byte[] key, final long by); static IncrRequest createIncr(final byte[] key, final long value); static IncrRequest createDecr(final byte[] key, final long value); @Override ByteBuf writeRequest(final ByteBufAllocator alloc, final ByteBuffer dst); @Override void handle(final AsciiResponse response, final HostAndPort server); long getBy(); long multiplier();  }
@Test public void testIncrRequest() { IncrRequest req = IncrRequest.createIncr("foo".getBytes(StandardCharsets.UTF_8), 2); assertRequest(req, "incr" + " foo 2\r\n"); }