byte flags = SettingsInfo.CLEAR_PERSISTED;
Settings settings = new Settings();
settings.put(new Settings.Setting(Settings.ID.DOWNLOAD_RETRANSMISSION_RATE, 100));
settings.put(new Settings.Setting(Settings.ID.ROUND_TRIP_TIME, 500));
SettingsFrame frame1 = new SettingsFrame(SPDY.V2, flags, settings);
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
ByteBuffer buffer = generator.control(frame1);
Assert.assertNotNull(buffer);
TestSPDYParserListener listener = new TestSPDYParserListener();
Parser parser = new Parser(new StandardCompressionFactory().newDecompressor());
parser.addListener(listener);
while (buffer.hasRemaining())
parser.parse(ByteBuffer.wrap(new byte[]{buffer.get()}));
ControlFrame frame2 = listener.getControlFrame();