### Question:
DefaultFlowControlHandler implements FlowControlHandler { @VisibleForTesting protected boolean tryConsume(final long sid, final long offset, final PipelineContext ctx) { final TryConsumeResult result = sendCounter.tryConsume(sid, offset); if (result.isSuccess()) { return true; } else { final List<Frame> frames = new ArrayList<>(); if (result.getConnectionOffset() > result.getConnectionMax() && !connectionBlocked.get()) { frames.add(new DataBlockedFrame(result.getConnectionMax())); connectionBlocked.set(true); } if (result.getStreamOffset() > result.getStreamMax() && !blockedStreams.contains(sid)) { frames.add(new StreamDataBlockedFrame(sid, result.getStreamMax())); blockedStreams.add(sid); } if (!frames.isEmpty()) { ctx.send(frames.toArray(new Frame[0])); } return false; } } DefaultFlowControlHandler(final long connectionMaxBytes, final long streamMaxBytes); @Override void beforeSendPacket(final Packet packet, final PipelineContext ctx); void onReceivePacket(final Packet packet, final PipelineContext ctx);  }### Answer:
@Test public void tryConsume() { assertTrue(handler.tryConsume(sid, 10, ctx)); verifyZeroInteractions(ctx); assertFalse(handler.tryConsume(sid, 11, ctx)); verify(ctx).send(new StreamDataBlockedFrame(sid, 10)); }