### Question:
PacketBufferManager implements InboundHandler, OutboundHandler { public void resend() { final Collection<Frame> toResend = buffer.drainSince(1000, MILLISECONDS); toResend.stream().forEach(frameSender::send); } 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 resend() throws Exception { final Packet pingPacket = packet(2, PingFrame.INSTANCE); buffer.beforeSendPacket(pingPacket, ctx); assertBuffered(2); when(ticker.nanoTime()).thenReturn(3000_0000_0000L); resendTask.run(timeout); verify(frameSender).send(PingFrame.INSTANCE); }