### Question:
ClusteredCompositeBlobStore implements BlobStore, ThreadCachingBean { @Override public void addListener(BlobStoreListener listener) { listeners.add(listener); cache.get().values().forEach(entry->{entry.store.addListener(listener);}); StoreAndConfig defaultEntry = defaultCache.get(); if(Objects.nonNull(defaultEntry)) { defaultEntry.store.addListener(listener); } } ClusteredCompositeBlobStore(TileLayerDispatcher layers,
            BlobStoreAggregator blobStoreAggregator); @Override boolean delete(String layerName); @Override boolean deleteByGridsetId(String layerName, String gridSetId); @Override boolean deleteByParametersId(String layerName, String parametersId); @Override boolean delete(TileObject obj); @Override boolean delete(TileRange obj); @Override boolean get(TileObject obj); @Override void put(TileObject obj); @Override void clear(); @Override void clearThreadCache(); @Override void destroy(); @Override void addListener(BlobStoreListener listener); @Override boolean removeListener(BlobStoreListener listener); @Override boolean rename(String oldLayerName, String newLayerName); @Override String getLayerMetadata(String layerName, String key); @Override void putLayerMetadata(String layerName, String key, String value); @Override boolean layerExists(String layerName); @Override Map<String, Optional<Map<String, String>>> getParametersMapping(String layerName); @Override boolean deleteByParameters(String layerName, Map<String, String> parameters); @Override Set<Map<String, String>> getParameters(String layerName); @Override Set<String> getParameterIds(String layerName); @Override boolean purgeOrphans(TileLayer layer);  }### Answer:
@Test public void testAddListener() throws Exception { bsAgg = EasyMock.createMock("bsAgg", BlobStoreAggregator.class); tld = EasyMock.createMock("tld", TileLayerDispatcher.class); testBlobStoreInfo = EasyMock.createMock("testBlobStoreInfo", BlobStoreInfo.class); testBlobStore1 = EasyMock.createMock("testBlobStore1", BlobStore.class); testLayer = EasyMock.createMock("testLayer", TileLayer.class); EasyMock.expect(tld.getTileLayer("testLayer")).andStubReturn(testLayer); EasyMock.expect(testLayer.getBlobStoreId()).andStubReturn("testBlobStore"); EasyMock.expect(bsAgg.getBlobStore("testBlobStore")).andStubReturn(testBlobStoreInfo); EasyMock.expect(testBlobStoreInfo.createInstance(EasyMock.eq(tld), EasyMock.anyObject(LockProvider.class))).andReturn(testBlobStore1).once(); EasyMock.expect(testBlobStoreInfo.isEnabled()).andStubReturn(true); EasyMock.expect(testBlobStore1.delete("testLayer")).andReturn(true).once(); BlobStoreListener testListener = EasyMock.createMock("testListener", BlobStoreListener.class); testBlobStore1.addListener(testListener);EasyMock.expectLastCall().once(); EasyMock.replay(bsAgg, tld, testLayer, testBlobStoreInfo, testBlobStore1, testListener); ClusteredCompositeBlobStore ccbs = new ClusteredCompositeBlobStore(tld, bsAgg); ccbs.addListener(testListener); ccbs.delete("testLayer"); EasyMock.verify(testBlobStore1); }