LoopbackBlobStore implements BlobStore { @Override public long getBlobLength(String blobId) throws IOException { return blobId.length(); }  @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 @Parameters(method = "blobIds") public void getBlobLengthShouldAlwaysReturnRealLengthOfBlobThatWillBeReturned( final String blobId) throws IOException { given: { final BlobStore store = new LoopbackBlobStore(); expect: { assertEquals(blobId.getBytes().length, store.getBlobLength(blobId)); } } }
@Test(expected = NullPointerException.class) public void getBlobLengthShouldAlwaysThrowAnExceptionWhenNullBlobIdIsPassed() throws IOException { given: { final BlobStore store = new LoopbackBlobStore(); when: { store.getBlobLength(null); } } }