@Test public void testLimit() throws IOException { LimitedStorage storage = createStorage(); saveTestObject(storage, TEST_NAME_1, TEST_DATA_1); saveTestObject(storage, TEST_NAME_2, TEST_DATA_2); saveTestObject(storage, TEST_NAME_3, TEST_DATA_3); assertFalse(storage.contains(TEST_NAME_1)); assertTrue(storage.contains(TEST_NAME_2)); assertTrue(storage.contains(TEST_NAME_3)); }
@Override public boolean contains(@NonNull String id) throws IOException { return journalingStorage.contains(id); }
LimitedStorage implements Storage { @Override public boolean contains(@NonNull String id) throws IOException { return journalingStorage.contains(id); } }
LimitedStorage implements Storage { @Override public boolean contains(@NonNull String id) throws IOException { return journalingStorage.contains(id); } LimitedStorage(JournalingStorage journalingStorage, long capacity); }
LimitedStorage implements Storage { @Override public boolean contains(@NonNull String id) throws IOException { return journalingStorage.contains(id); } LimitedStorage(JournalingStorage journalingStorage, long capacity); @Override boolean contains(@NonNull String id); @NonNull @Override OutputStream openOutputStream(@NonNull String id); @Nullable @Override InputStream openInputStream(@NonNull String id); @Override boolean delete(@NonNull String id); @Override void deleteAll(); void setCapacity(long capacity); long getCapacity(); }
LimitedStorage implements Storage { @Override public boolean contains(@NonNull String id) throws IOException { return journalingStorage.contains(id); } LimitedStorage(JournalingStorage journalingStorage, long capacity); @Override boolean contains(@NonNull String id); @NonNull @Override OutputStream openOutputStream(@NonNull String id); @Nullable @Override InputStream openInputStream(@NonNull String id); @Override boolean delete(@NonNull String id); @Override void deleteAll(); void setCapacity(long capacity); long getCapacity();  }