/** Tests that {@link StreamWriteFilter#setWriteBufferSize(int)} checks the specified size. */
  @Test
  public void testSetWriteBufferSize() {
    AbstractStreamWriteFilter<M> filter = createFilter();

    try {
      filter.setWriteBufferSize(0);
      fail("0 writeBuferSize specified. IllegalArgumentException expected.");
    } catch (IllegalArgumentException iae) {
      // Pass, exception was thrown
      // Signifies a successful test execution
      assertTrue(true);
    }

    try {
      filter.setWriteBufferSize(-100);
      fail("Negative writeBuferSize specified. IllegalArgumentException expected.");
    } catch (IllegalArgumentException iae) {
      // Pass, exception was thrown
      // Signifies a successful test execution
      assertTrue(true);
    }

    filter.setWriteBufferSize(1);
    assertEquals(1, filter.getWriteBufferSize());
    filter.setWriteBufferSize(1024);
    assertEquals(1024, filter.getWriteBufferSize());
  }