### Question:
AttributionTransformer extends DefaultTransformer implements DataRegistryListener<TileSetMetadata> { @Override public void allValuesRemoved(Object source) { List<LabelGeometry> removals = New.list(myGeometries.values()); myGeometries.clear(); publishGeometries(Collections.emptyList(), removals); } AttributionTransformer(DataRegistry dataRegistry, MapManager mapManager); @Override void open(); @Override void close(); @Override void allValuesRemoved(Object source); @Override boolean isIdArrayNeeded(); @Override boolean isWantingRemovedObjects(); @Override void valuesAdded(DataModelCategory dataModelCategory, long[] ids, Iterable<? extends TileSetMetadata> newValues,
            Object source); @Override void valuesRemoved(DataModelCategory dataModelCategory, long[] ids, Iterable<? extends TileSetMetadata> removedValues,
            Object source); @Override void valuesRemoved(DataModelCategory dataModelCategory, long[] ids, Object source); @Override void valuesUpdated(DataModelCategory dataModelCategory, long[] ids, Iterable<? extends TileSetMetadata> newValues,
            Object source);  }### Answer:
@Test public void testAllValuesRemoved() { EasyMockSupport support = new EasyMockSupport(); DataRegistry dataRegistry = createDataRegistry(support); List<Geometry> publishedGeometries = New.list(); GenericSubscriber<Geometry> subscriber = createSubscriber(support, publishedGeometries); MapManager mapManager = createMapManager(support); support.replayAll(); AttributionTransformer transformer = new AttributionTransformer(dataRegistry, mapManager); transformer.addSubscriber(subscriber); transformer.open(); TileSetMetadata metadata = new TileSetMetadata(); metadata.setAttribution("I am attribution"); transformer.valuesAdded(new DataModelCategory(ourServer, TileSetMetadata.class.getName(), ourTileSet), new long[] { 1 }, New.list(metadata), this); assertEquals(1, publishedGeometries.size()); assertEquals("Terrain provided by I am attribution", ((LabelGeometry)publishedGeometries.get(0)).getText()); transformer.allValuesRemoved(this); assertEquals(0, publishedGeometries.size()); transformer.close(); support.verifyAll(); }