### Question:
DefaultStreamManager implements StreamManager { @Override public Stream openStream(final boolean client, final boolean bidirectional) { return streams.openStream(client, bidirectional, listener); } DefaultStreamManager(final FrameSender frameSender, final StreamListener listener); @Override void onReceivePacket(final Packet packet, final PipelineContext ctx); @Override Stream openStream(final boolean client, final boolean bidirectional);  }### Answer:
@Test public void streamSingleWrite() { final Stream stream = manager.openStream(true, true); stream.write(DATA1, true); verify(ctx).send(new StreamFrame(stream.getId(), 0, true, DATA1)); assertTrue(stream.isFinished()); }
@Test public void streamMultiWrite() { final Stream stream = manager.openStream(true, true); stream.write(DATA1, false); verify(ctx).send(new StreamFrame(stream.getId(), 0, false, DATA1)); assertFalse(stream.isFinished()); stream.write(DATA2, true); verify(ctx).send(new StreamFrame(stream.getId(), DATA1.length, true, DATA2)); assertTrue(stream.isFinished()); }
@Test public void streamReset() { final Stream stream = manager.openStream(true, true); stream.write(DATA1, false); verify(ctx).send(new StreamFrame(stream.getId(), 0, false, DATA1)); stream.reset(123); verify(ctx).send(new ResetStreamFrame(stream.getId(), 123, DATA1.length)); assertTrue(stream.isFinished()); }