### Question:
NonBlockingBufferedWriter extends Writer { @Override public void write (final int c) throws IOException { _ensureOpen (); if (m_nNextChar >= m_nChars) flushBuffer (); m_aBuf[m_nNextChar++] = (char) c; } NonBlockingBufferedWriter(@Nonnull final Writer aWriter);  NonBlockingBufferedWriter(@Nonnull final Writer aWriter, @Nonnegative final int nBufSize); @Override void write(final int c); @Override @SuppressFBWarnings ("IL_INFINITE_LOOP") void write(final char [] cbuf, final int nOfs, final int nLen); @Override @SuppressFBWarnings ("IL_INFINITE_LOOP") void write(final String s, final int off, final int len); void reset(); @Nonnegative int getSize(); @Nonnegative int getBufferSize(); boolean isEmpty(); @Nonnull @ReturnsMutableCopy String getAsString(); @Nonnull String getAsString(@Nonnegative final int nLength); void newLine(); @Override void flush(); @Override void close();  }### Answer:
@Test @SuppressWarnings ("resource") @SuppressFBWarnings ("OS_OPEN_STREAM") public void testError () throws IOException { try { new NonBlockingStringWriter (-1); fail (); } catch (final IllegalArgumentException ex) {} try { new NonBlockingBufferedWriter (new NonBlockingStringWriter (-1)); fail (); } catch (final IllegalArgumentException ex) {} final char [] ca = "abc".toCharArray (); try { new NonBlockingBufferedWriter (new NonBlockingStringWriter (-1)).write (ca, -1, 1); fail (); } catch (final IllegalArgumentException ex) {} try { new NonBlockingBufferedWriter (new NonBlockingStringWriter (-1)).write (ca, 0, -1); fail (); } catch (final IllegalArgumentException ex) {} try { new NonBlockingBufferedWriter (new NonBlockingStringWriter (-1)).write (ca, 2, 5); fail (); } catch (final IllegalArgumentException ex) {} }