### Question:
RotateImageTransformerImpl 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 degrees = properties.get(KEY_DEGREES, 0) % TOTAL_DEGREES; layer.rotate(degrees); return layer; }  @Override final Layer transform(final Layer layer, final ValueMap properties);  }### Answer:
@Test public void testTransform() throws Exception { final int degrees = 50; map.put("degrees", degrees); ValueMap properties = new ValueMapDecorator(map); transformer.transform(layer, properties); verify(layer, times(1)).rotate(degrees); verifyNoMoreInteractions(layer); }
@Test public void testTransform_mod() throws Exception { final int degrees = 5; map.put("degrees", 360 + degrees); ValueMap properties = new ValueMapDecorator(map); transformer.transform(layer, properties); verify(layer, times(1)).rotate(degrees); verifyNoMoreInteractions(layer); }
@Test public void testTransform_neg() throws Exception { final int degrees = -15; map.put("degrees", -360 + degrees); ValueMap properties = new ValueMapDecorator(map); transformer.transform(layer, properties); verify(layer, times(1)).rotate(degrees); verifyNoMoreInteractions(layer); }
@Test public void testTransform_emptyParams() throws Exception { ValueMap properties = new ValueMapDecorator(map); transformer.transform(layer, properties); verifyNoInteractions(layer); }
@Test public void testTransform_nullParams() throws Exception { transformer.transform(layer, null); verifyNoInteractions(layer); }