LoopbackBlobStoreFactory implements BlobStoreFactory { @Override public BlobStore create(Closer closer) { checkNotNull(closer, "Closer object cannot be null"); return new LoopbackBlobStore(); }  @Override BlobStore create(Closer closer); @Override String toString();  }
@Test(expected = NullPointerException.class) public void cannotCreateLoopbackBlobStoreFactoryWithNullCloser() { when: { final LoopbackBlobStoreFactory factory = new LoopbackBlobStoreFactory(); factory.create(null); } }
@Test public void canCreateLoopbackBlobStoreFactory() throws IOException { when: { final LoopbackBlobStoreFactory factory = new LoopbackBlobStoreFactory(); final Closer closer = Closer.create(); final BlobStore blobStore = factory.create(closer); then: { assertNotNull(blobStore); } and: { closer.close(); } } }