### Question:
ServerConnection extends UnicastExportable implements RemoteConnection { @Override public RemoteBlobCreator getBlobCreator(long estimatedSize, Map<String, String> hints) throws IOException { return new ServerBlobCreator(con, estimatedSize, hints, getExporter()); } ServerConnection(BlobStoreConnection con, Exporter exporter); @Override RemoteBlob getBlob(URI id, Map<String, String> hints); @Override RemoteBlobCreator getBlobCreator(long estimatedSize, Map<String, String> hints); @Override RemoteIterator<URI> listBlobIds(String filterPrefix); @Override void sync(); @Override void close(); @Override void unreferenced();  }### Answer:
@Test public void testGetBlobCreator() throws IOException { Map<String, String> hints = new HashMap<String, String>(); hints.put("try harder?", "yes, of course!"); Blob blob = createMock(Blob.class); reset(con); makeThreadSafe(con, true); expect(con.getBlob(isA(PipedInputStream.class), eq(42L), eq(hints))).andReturn(blob); expect(con.getBlob(isA(PipedInputStream.class), eq(-1L), eq(hints))) .andThrow(new UnsupportedOperationException()); replay(con); RemoteBlobCreator rbc = sc.getBlobCreator(42L, hints); assertTrue(rbc instanceof ServerBlobCreator); RemoteBlob rb = rbc.shutDown(false); assertTrue(rb instanceof ServerBlob); assertEquals(blob, ((ServerBlob)rb).getBlob()); try { sc.getBlobCreator(-1L, hints).shutDown(false); fail("Failed to rcv expected exception"); } catch (UnsupportedOperationException e) { } verify(con); }