### Question:
AttributionTransformer extends DefaultTransformer implements DataRegistryListener<TileSetMetadata> { @Override public void valuesAdded(DataModelCategory dataModelCategory, long[] ids, Iterable<? extends TileSetMetadata> newValues, Object source) { LabelGeometry.Builder<ScreenPosition> builder = new Builder<>(); builder.setText("Terrain provided by " + newValues.iterator().next().getAttribution()); builder.setOutlined(true); builder.setPosition(getPosition()); builder.setFont(""); LabelRenderProperties props = new DefaultLabelRenderProperties(ZOrderRenderProperties.TOP_Z, true, false); props.setColor(Color.white); LabelGeometry label = new LabelGeometry(builder, props, null); myGeometries.put(dataModelCategory.getSource() + dataModelCategory.getCategory(), label); publishGeometries(Collections.singletonList(label), Collections.emptyList()); } 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 testValuesAdded() { 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()); LabelGeometry label = (LabelGeometry)publishedGeometries.get(0); assertEquals("Terrain provided by I am attribution", label.getText()); assertEquals(2, label.getPosition().asVector2d().getX(), 0); assertEquals(498, label.getPosition().asVector2d().getY(), 0); transformer.valuesRemoved(new DataModelCategory(ourServer, TileSetMetadata.class.getName(), "Some other Tile"), new long[] { 2 }, this); assertEquals(1, publishedGeometries.size()); transformer.valuesRemoved(new DataModelCategory(ourServer, TileSetMetadata.class.getName(), ourTileSet), new long[] { 1 }, this); assertEquals(0, publishedGeometries.size()); transformer.close(); support.verifyAll(); }