### Question:
STKLayerTransformer extends DefaultTransformer implements DataRegistryListener<TileSetMetadata> { @Override public void allValuesRemoved(Object source) { List<TerrainTileGeometry> removals = New.list(); for (Entry<String, List<TerrainTileGeometry>> entry : myPublishedGeometries.entrySet()) { removals.addAll(entry.getValue()); } myPublishedGeometries.clear(); publishGeometries(New.collection(), removals); } STKLayerTransformer(DataRegistry dataRegistry, DataGroupController groupController, EventManager eventManager); @Override void allValuesRemoved(Object source); @Override void close(); @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); DataGroupController groupController = createGroupController(support, Boolean.TRUE); EventManager eventManager = createEventManager(support); support.replayAll(); STKLayerTransformer transformer = new STKLayerTransformer(dataRegistry, groupController, eventManager); transformer.addSubscriber(subscriber); transformer.open(); TileSetMetadata metadata = new TileSetMetadata(); transformer.valuesAdded(new DataModelCategory(ourServer, TileSetMetadata.class.getName(), ourTileSet), new long[] { 1 }, New.list(metadata), this); assertEquals(2, publishedGeometries.size()); transformer.allValuesRemoved(this); assertEquals(0, publishedGeometries.size()); transformer.close(); support.verifyAll(); }