CacheManager implements Closeable { public CacheManager() { this.primary = new CacheStore(); } CacheManager(); void initialize(); @Nullable Object get(@Nonnull Object key); void put(@Nonnull Object key, @Nonnull Object value); @Override void close(); void setPrimary(Primary primary); @JsonIgnore Primary getPrimary(); void setBackup(Backup backup); @JsonIgnore Backup getBackup(); void setRefreshTime(String time); String getRefreshTime(); int getNumInitCachedLines(); void setNumInitCachedLines(int numInitCachedLines); boolean getReadOnlyData(); void setReadOnlyData(boolean isReadOnly);  }
@Test public void testCacheManager() throws IOException { CacheManager manager = new CacheManager(); manager.setBackup(new DummyBackupStore()); manager.initialize(); Assert.assertEquals("manager initialization- value", "one", manager.primary.get(1)); Assert.assertEquals("manager initializaton- total", 5, manager.primary.getKeys().size()); Assert.assertEquals("backup hit", "six", manager.get(6)); Assert.assertEquals("primary updated- total", 6, manager.primary.getKeys().size()); }