### Question:
NonBlockingStringWriter extends Writer implements IHasSize { @Override public void write (final int c) { m_aSB.append ((char) c); } NonBlockingStringWriter();  NonBlockingStringWriter(@Nonnegative final int nInitialSize); @Override void write(final int c); @Override void write(@Nonnull final char [] aBuf, @Nonnegative final int nOfs, @Nonnegative final int nLen); @Override void write(@Nullable final String sStr); @Override void write(@Nonnull final String sStr, final int nOfs, final int nLen); @Override NonBlockingStringWriter append(final CharSequence aCS); @Override NonBlockingStringWriter append(final CharSequence aCS, final int nStart, final int nEnd); @Override NonBlockingStringWriter append(final char c); @Override void flush(); @Override void close(); @Nonnull @ReturnsMutableObject ("design") StringBuilder directGetStringBuilder(); @Nonnull @ReturnsMutableCopy char [] getAsCharArray(); @Nonnull String getAsString(); void reset(); @Nonnegative int size(); boolean isEmpty(); @Override @Deprecated String toString();  }### Answer:
@Test @SuppressWarnings ("resource") @SuppressFBWarnings ("OS_OPEN_STREAM") public void testError () { try { new NonBlockingStringWriter (-1); fail (); } catch (final IllegalArgumentException ex) {} final char [] ca = "abc".toCharArray (); try { new NonBlockingStringWriter ().write (ca, -1, 1); fail (); } catch (final IllegalArgumentException ex) {} try { new NonBlockingStringWriter ().write (ca, 0, -1); fail (); } catch (final IllegalArgumentException ex) {} try { new NonBlockingStringWriter ().write (ca, 2, 5); fail (); } catch (final IllegalArgumentException ex) {} }