### Question:
ClientBlob extends AbstractBlob { @Override public Blob moveTo(URI blobId, Map<String, String> hints) throws IOException { ensureOpen(); return new ClientBlob(getConnection(), streamMgr, remote.moveTo(blobId, hints)); } ClientBlob(BlobStoreConnection con, StreamManager streamMgr,
                    RemoteBlob remote); @Override URI getCanonicalId(); @Override InputStream openInputStream(); @Override OutputStream openOutputStream(long estSize, boolean overwrite); @Override long getSize(); @Override boolean exists(); @Override void delete(); @Override Blob moveTo(URI blobId, Map<String, String> hints);  }### Answer:
@Test public void testMoveTo() throws IOException { URI id1 = URI.create("foo:1"); URI id2 = URI.create("foo:2"); BlobStoreConnection con = createMock(BlobStoreConnection.class); Blob blob2 = createMock(Blob.class); reset(blob); expect(blob.getConnection()).andStubReturn(con); expect(blob2.getConnection()).andStubReturn(con); expect(blob.getId()).andStubReturn(id1); expect(blob2.getId()).andStubReturn(id2); expect(con.getBlob(id1, null)).andStubReturn(blob); expect(con.getBlob(id2, null)).andStubReturn(blob2); expect(blob.moveTo(id1, null)).andStubThrow(new DuplicateBlobException(id1)); expect(blob.moveTo(id2, null)).andStubReturn(blob2); expect(blob.moveTo(null, null)).andStubThrow(new UnsupportedOperationException()); replay(blob); replay(blob2); replay(con); ServerBlob sb = new ServerBlob(blob, exporter); ClientBlob cb = new ClientBlob(this.cb.getConnection(), new StreamManager(), (RemoteBlob) sb.getExported()); ServerBlob sb2 = new ServerBlob(blob2, exporter); ClientBlob cb2 = new ClientBlob(cb.getConnection(), new StreamManager(), (RemoteBlob) sb2.getExported()); try { cb.moveTo(cb.getId(), null); fail("Failed to rcv expected exception"); } catch (DuplicateBlobException e) { } cb.moveTo(cb2.getId(), null); try { cb.moveTo(null, null); fail("Failed to rcv expected exception"); } catch (UnsupportedOperationException e) { } verify(blob); sb.unExport(false); sb2.unExport(false); }