### Question:
PacketBufferManager implements InboundHandler, OutboundHandler { @Override public void beforeSendPacket(final Packet packet, final PipelineContext ctx) { requireNonNull(packet); requireNonNull(ctx); if (packet instanceof FullPacket) { FullPacket fp = (FullPacket) packet; buffer(fp); final Pair<List<AckBlock>, Long> drained = drainAcks(getEncryptionLevel(fp)); final List<AckBlock> ackBlocks = drained.getFirst(); if (!ackBlocks.isEmpty()) { final long delay = ackDelay.calculate(drained.getSecond(), NANOSECONDS); final AckFrame ackFrame = new AckFrame(delay, ackBlocks); fp = fp.addFrame(ackFrame); } ctx.next(fp); } else { ctx.next(packet); } } PacketBufferManager(
      final AckDelay ackDelay,
      final FrameSender frameSender,
      final Timer timer,
      final Ticker ticker); void resend(); @Override void beforeSendPacket(final Packet packet, final PipelineContext ctx); @Override void onReceivePacket(final Packet packet, final PipelineContext ctx);  }### Answer:
@Test public void send() { final Packet pingPacket = packet(2, PingFrame.INSTANCE); buffer.beforeSendPacket(pingPacket, ctx); final Packet actual = verifyNext(); assertEquals(pingPacket, actual); assertBuffered(2); }