### Question:
ServerOutputStream extends UnicastExportable implements RemoteOutputStream, Closeable { @Override public void unreferenced() { try { close(); } catch (IOException e) { log.warn("Ignoring error in close of unreferenced OutputStream", e); } } 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 testUnreferenced() 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.unreferenced(); assertTrue(closed[0]); assertTrue(closed[1]); }