@Test public void testSingleReference() throws Exception { DummyStorage storage = new DummyStorage(); MultiReferenceStorage multiReferenceStorage = new MultiReferenceStorage( storage); Assert.assertFalse(storage.deleted); multiReferenceStorage.delete(); Assert.assertTrue(storage.deleted); }
public void delete() { if (decrementCounter()) { storage.delete(); } }
MultiReferenceStorage implements Storage { public void delete() { if (decrementCounter()) { storage.delete(); } } }
MultiReferenceStorage implements Storage { public void delete() { if (decrementCounter()) { storage.delete(); } } MultiReferenceStorage(Storage storage); }
MultiReferenceStorage implements Storage { public void delete() { if (decrementCounter()) { storage.delete(); } } MultiReferenceStorage(Storage storage); void addReference(); void delete(); InputStream getInputStream(); }
MultiReferenceStorage implements Storage { public void delete() { if (decrementCounter()) { storage.delete(); } } MultiReferenceStorage(Storage storage); void addReference(); void delete(); InputStream getInputStream();  }