### Question:
ServerBlob extends UnicastExportable implements RemoteBlob { @Override public RemoteBlob moveTo(URI other, Map<String, String> hints) throws IOException { return new ServerBlob(blob.moveTo(other, hints), getExporter()); } ServerBlob(Blob blob, Exporter exporter); @Override URI getId(); @Override URI getCanonicalId(); @Override boolean exists(); @Override long getSize(); @Override void delete(); @Override RemoteBlob moveTo(URI other, Map<String, String> hints); @Override RemoteInputStream openInputStream(); @Override RemoteOutputStream openOutputStream(long estimatedSize, boolean overwrite);  }### 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); try { sb.moveTo(blob.getId(), null); fail("Failed to rcv expected exception"); } catch (DuplicateBlobException e) { } sb.moveTo(blob2.getId(), null); try { sb.moveTo(null, null); fail("Failed to rcv expected exception"); } catch (UnsupportedOperationException e) { } verify(blob); }