@Test
public void testWriteBoundary() throws IOException {

    StringBuilder stringBuilder = new StringBuilder(256);
    CharacterStreamCommunication.writeBoundary("abc", stringBuilder);
    Assert.assertEquals(stringBuilder.toString(), "X-Object-Boundary: abc\n");
    try {
        CharacterStreamCommunication.writeBoundary("foo ", stringBuilder);
        Assert.fail();
    } catch (IllegalArgumentException ignored) { }
    try {
        CharacterStreamCommunication.writeBoundary("garçon", stringBuilder);
        Assert.fail();
    } catch (IllegalArgumentException ignored) { }
}