@Override
    public void writeTo(Integer entity, ByteBuf target) {
        if (entity == null || target == null) {
            return;
        }
        target.writeInt(entity);
    }
@Test
    public void testWritePingResponseAndParse() {
        ByteBuf buf = Unpooled.buffer();
        PingResponseDataWriter writer = new PingResponseDataWriter();

        int small = 120;
        writer.writeTo(small, buf);
        assertThat(buf.readableBytes()).isGreaterThanOrEqualTo(4);
        assertThat(buf.readInt()).isEqualTo(small);

        int big = Integer.MAX_VALUE;
        writer.writeTo(big, buf);
        assertThat(buf.readableBytes()).isGreaterThanOrEqualTo(4);
        assertThat(buf.readInt()).isEqualTo(big);

        buf.release();
    }