### Question:
STKLayerTransformer extends DefaultTransformer implements DataRegistryListener<TileSetMetadata> { @Override public void valuesAdded(DataModelCategory dataModelCategory, long[] ids, Iterable<? extends TileSetMetadata> newValues, Object source) { String serverUrl = dataModelCategory.getSource(); String tileSetName = dataModelCategory.getCategory(); String layerKey = serverUrl + tileSetName; TileSetMetadata tileSetMetadata = newValues.iterator().next(); STKTerrainTileDivider divider = new STKTerrainTileDivider(layerKey, tileSetMetadata); DataTypeInfo dataType = myGroupController.findMemberById(layerKey); List<TerrainTileGeometry> geometries = myBuilder.buildInitialGeometries(layerKey, serverUrl, tileSetName, tileSetMetadata, divider, dataType.getMapVisualizationInfo().getTileRenderProperties()); myPublishedGeometries.put(layerKey, geometries); if (dataType.isVisible()) { publishGeometries(geometries, New.collection()); } } 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 testValuesAdded() { EasyMockSupport support = new EasyMockSupport(); DataRegistry dataRegistry = createDataRegistry(support); List<Geometry> publishedGeometries = New.list(); GenericSubscriber<Geometry> subscriber = createSubscriber(support, publishedGeometries); DataGroupController typeController = createGroupController(support, Boolean.TRUE); EventManager eventManager = createEventManager(support); support.replayAll(); STKLayerTransformer transformer = new STKLayerTransformer(dataRegistry, typeController, 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()); int index = 0; for (ZYXImageKey key : ourZeroExpectedKeys) { TerrainTileGeometry geometry = (TerrainTileGeometry)publishedGeometries.get(index); assertEquals(key.toString(), geometry.getImageManager().getImageKey().toString()); index++; } transformer.valuesRemoved(new DataModelCategory(ourServer, TileSetMetadata.class.getName(), "Some other Tile"), new long[] { 2 }, this); assertEquals(2, publishedGeometries.size()); transformer.valuesRemoved(new DataModelCategory(ourServer, TileSetMetadata.class.getName(), ourTileSet), new long[] { 1 }, this); assertEquals(0, publishedGeometries.size()); transformer.close(); support.verifyAll(); }