@Test
public void testSettingsToStream() throws Exception {

    final SessionSettings expectedSettings = setUpSession();
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    expectedSettings.toStream(out);
    final String writtenSettingsString = new String(out.toByteArray());
    assertSettingsEqual(expectedSettings, writtenSettingsString);
}