@Override
    public ChannelFuture writePing(ChannelHandlerContext ctx, boolean ack, long data, ChannelPromise promise) {
        // Only apply the limit to ping acks.
        if (ack) {
            ChannelPromise newPromise = handleOutstandingControlFrames(ctx, promise);
            if (newPromise == null) {
                return promise;
            }
            return super.writePing(ctx, ack, data, newPromise);
        }
        return super.writePing(ctx, ack, data, promise);
    }
@Test
    public void testNotLimitPing() {
        assertTrue(encoder.writePing(ctx, false, 8, newPromise()).isSuccess());
        assertTrue(encoder.writePing(ctx, false, 8, newPromise()).isSuccess());
        assertTrue(encoder.writePing(ctx, false, 8, newPromise()).isSuccess());
        assertTrue(encoder.writePing(ctx, false, 8, newPromise()).isSuccess());

        verifyFlushAndClose(0, false);
    }