### Question:
ServerConnection extends UnicastExportable implements RemoteConnection { @Override public RemoteIterator<URI> listBlobIds(String filterPrefix) throws IOException { return new ServerIterator<URI>(con.listBlobIds(filterPrefix), 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 testListBlobIds() throws IOException { URI id = URI.create("foo:bar"); Iterator<URI> it = Arrays.asList(id).iterator(); reset(con); expect(con.listBlobIds(null)).andReturn(it); replay(con); RemoteIterator<URI> ri = sc.listBlobIds(null); assertTrue(ri instanceof ServerIterator<?>); assertEquals(it, ((ServerIterator<URI>) ri).getIterator()); verify(con); }