DiskStoreManager extends CacheConfigurationManager<DiskStore> { @Override public DiskStore get(DiskStore config, CacheConfig existing) { return existing.getDiskStores().stream() .filter(diskStoreType -> diskStoreType.getName().equals(config.getName())).map( diskStoreConverter::fromXmlObject) .findFirst().orElse(null); } DiskStoreManager(ConfigurationPersistenceService service); @Override void add(DiskStore config, CacheConfig existing); @Override void update(DiskStore config, CacheConfig existing); @Override void delete(DiskStore config, CacheConfig existing); @Override List<DiskStore> list(DiskStore filterConfig, CacheConfig existing); @Override DiskStore get(DiskStore config, CacheConfig existing);  }
@Test public void getShouldReturnNullIfNoDiskStoresExist() { DiskStoreType diskStoreType = new DiskStoreType(); diskStoreType.setName(diskStore.getName()); DiskStore foundDiskStore = manager.get(diskStore, cacheConfig); assertThat(foundDiskStore).isNull(); }