### Question:
ServerBlob extends UnicastExportable implements RemoteBlob { @Override public RemoteInputStream openInputStream() throws IOException { return new ServerInputStream(blob.openInputStream(), 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 testOpenInputStream() throws IOException { URI id = URI.create("foo:bar"); InputStream in = createMock(InputStream.class); reset(blob); expect(blob.openInputStream()).andReturn(in); expect(blob.openInputStream()).andThrow(new MissingBlobException(id)); replay(blob); RemoteInputStream ri = sb.openInputStream(); assertTrue(ri instanceof ServerInputStream); assertEquals(((ServerInputStream) ri).getInputStream(), in); try { sb.openInputStream(); fail("Failed to rcv expected exception"); } catch (MissingBlobException e) { assertEquals(id, e.getBlobId()); } verify(blob); }