LoopbackBlobStore implements BlobStore { @Override public InputStream getInputStream(String blobId) throws IOException { checkNotNull(blobId); return new ByteArrayInputStream(getBlobIdStringAsByteArray(blobId)); }  @Override String writeBlob(InputStream in); @Override String writeBlob(InputStream in, BlobOptions options); @Override int readBlob(String blobId, long pos, byte[] buff, int off,
            int length); @Override long getBlobLength(String blobId); @Override InputStream getInputStream(String blobId); @Override String getBlobId(@NotNull String reference); @Override String getReference(@NotNull String blobId); @Override void close();  }
@Test(expected = NullPointerException.class) public void getInputStreamShouldAlwaysThrowAnExceptionWhenNullBlobIdIsPassed() throws IOException { given: { final BlobStore store = new LoopbackBlobStore(); when: { store.getInputStream(null); } } }
@Test @Parameters(method = "blobIds") public void shouldAlwaysReturnStreamOfRequestedBlobIdUtf8BinRepresentation( final String blobId) throws IOException { given: { final String encoding = "UTF-8"; final BlobStore store = new LoopbackBlobStore(); when: { final InputStream inputStream = store.getInputStream(blobId); then: { assertNotNull(inputStream); } and: { final String actualInputStreamAsString = IOUtils.toString( inputStream, encoding); then: { assertEquals(actualInputStreamAsString, blobId); } } } } }