### Question:
AdjustImageTransformerImpl implements ImageTransformer { @Override public final Layer transform(final Layer layer, final ValueMap properties) { if (properties == null || properties.isEmpty()) { log.warn("Transform [ {} ] requires parameters.", TYPE); return layer; } log.debug("Transforming with [ {} ]", TYPE); int brightness = properties.get(KEY_BRIGHTNESS, properties.get(KEY_BRIGHTNESS_ALIAS, 0)); float contrast = properties.get(KEY_CONTRAST, properties.get(KEY_CONTRAST_ALIAS, 1.0)).floatValue(); layer.adjust(brightness, contrast); return layer; }  @Override final Layer transform(final Layer layer, final ValueMap properties);  }### Answer:
@Test public void testTransform() throws Exception { final Integer brightness = 100; final Float contrast = 0.05F; map.put("brightness", brightness.toString()); map.put("contrast", contrast.toString()); ValueMap properties = new ValueMapDecorator(map); transformer.transform(layer, properties); verify(layer, times(1)).adjust(brightness, contrast); verifyNoMoreInteractions(layer); }
@Test public void testTransform_noParams() throws Exception { ValueMap properties = new ValueMapDecorator(map); transformer.transform(layer, properties); verifyNoInteractions(layer); }
@Test public void testTransform_onlyBrightness() throws Exception { final Integer brightness = 100; map.put("brightness", brightness.toString()); ValueMap properties = new ValueMapDecorator(map); transformer.transform(layer, properties); verify(layer, times(1)).adjust(brightness, 1F); verifyNoMoreInteractions(layer); }
@Test public void testTransform_onlyContrast() throws Exception { final Float contrast = 0.05F; map.put("contrast", contrast.toString()); ValueMap properties = new ValueMapDecorator(map); transformer.transform(layer, properties); verify(layer, times(1)).adjust(0, contrast); verifyNoMoreInteractions(layer); }