### Question:
ClientConnection extends AbstractBlobStoreConnection { @Override public Iterator<URI> listBlobIds(String filterPrefix) throws IOException { ensureOpen(); RemoteIterator<URI> ri = remote.listBlobIds(filterPrefix); return new ClientIterator<URI>(ri, ITERATOR_BATCH_SIZE); } ClientConnection(BlobStore store, StreamManager strMgr, RemoteConnection con); @Override void close(); @Override Blob getBlob(URI blobId, Map<String, String> hints); @Override Blob getBlob(InputStream in, long estimatedSize, Map<String, String> hints); @Override Iterator<URI> listBlobIds(String filterPrefix); @Override void sync(); static int ITERATOR_BATCH_SIZE; }### 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); Iterator<URI> ri = cc.listBlobIds(null); assertTrue(ri instanceof ClientIterator<?>); assertTrue(ri.hasNext()); assertEquals(id, ri.next()); assertFalse(ri.hasNext()); verify(con); }