### Question:
ClientOutputStream extends OutputStream { @Override public void close() throws IOException { remote.close(); } ClientOutputStream(RemoteOutputStream out); @Override void close(); @Override void flush(); @Override void write(int b); @Override void write(byte[] buf); @Override void write(byte[] buf, int off, int len);  }### Answer:
@Test public void testClose() throws IOException { ServerOutputStream so = new ServerOutputStream(bo, exporter); ClientOutputStream co = new ClientOutputStream((RemoteOutputStream) so.getExported()); co.close(); try { for (int i = 0; i < 10; i++) { try { Thread.sleep(Exporter.RETRY_DELAY * i); } catch (InterruptedException e) { } co.write('a'); } fail("Failed to get expected exception"); } catch (NoSuchObjectException e) { } }