### Question:
ProxyWriter extends FilterWriter { @Override public void close() throws IOException { try { out.close(); } catch (final IOException e) { handleIOException(e); } } ProxyWriter(final Writer proxy); @Override Writer append(final char c); @Override Writer append(final CharSequence csq, final int start, final int end); @Override Writer append(final CharSequence csq); @Override void write(final int idx); @Override void write(final char[] chr); @Override void write(final char[] chr, final int st, final int len); @Override void write(final String str); @Override void write(final String str, final int st, final int len); @Override void flush(); @Override void close();  }### Answer:
@Test(expected = UnsupportedEncodingException.class) public void exceptions_in_close() throws IOException { OutputStreamWriter osw = new OutputStreamWriter(new ByteArrayOutputStream()) { @Override public void close() throws IOException { throw new UnsupportedEncodingException("Bah"); } }; final ProxyWriter proxy = new ProxyWriter(osw); proxy.close(); }