### Question:
ServerOutputStream extends UnicastExportable implements RemoteOutputStream, Closeable { public void close() throws IOException { unExport(false); out.close(); } ServerOutputStream(OutputStream out, Exporter exporter); void write(int b); void write(byte[] b); void write(PartialBuffer b); void flush(); void close(); @Override void unreferenced();  }### Answer:
@Test public void testClose() throws IOException { final boolean[] closed = new boolean[] { false, false }; OutputStream out = new OutputStream() { @Override public void close() throws IOException { closed[0] = true; } @Override public void write(int b) throws IOException { } }; ServerOutputStream so = new ServerOutputStream(out, exporter) { private static final long serialVersionUID = 1L; @Override public void unExport(boolean force) { closed[1] = true; super.unExport(force); } }; assertFalse(closed[0]); assertFalse(closed[1]); so.close(); assertTrue(closed[0]); assertTrue(closed[1]); }