### Question:
LetterPillarBoxImageTransformerImpl 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); Dimension newSize = getResizeDimensions(properties, layer); Color color = getColor(properties); Layer resized = resize(layer, newSize); Layer result = build(newSize, resized, color); return result; }  @Override final Layer transform(final Layer layer, final ValueMap properties); @Property(label = "Max dimension in px",
            description = "Maximum size height and width can be re-sized to. [ Default: 50000 ]",
            intValue = DEFAULT_MAX_DIMENSION)
    static final String PROP_MAX_DIMENSION; }### Answer:
@Test public void testTransform() throws Exception { final int width = 400; final int height = 225; map.put("width", width); map.put("height", height); final ValueMap properties = new ValueMapDecorator(map); final Layer mockLayer = mock(Layer.class); final Transformer transformer = new Transformer(mockLayer); when(layer.getWidth()).thenReturn(START_WIDTH, START_WIDTH, width); when(layer.getHeight()).thenReturn(START_HEIGHT, START_HEIGHT, height); doNothing().when(mockLayer).blit(any(Layer.class), anyInt(), anyInt(), anyInt(), anyInt(), anyInt(), anyInt()); transformer.transform(layer, properties); assertNotNull("Layer constructor was not intercepted.", transformer.layerCreated); verify(layer, times(3)).getWidth(); verify(layer, times(3)).getHeight(); verify(layer, times(1)).resize(width, height); verify(mockLayer, times(1)).blit(layer, 0, 0, width, height, 0, 0); verifyNoMoreInteractions(layer); verifyNoMoreInteractions(mockLayer); }
@Test public void testTransform_emptyParams() throws Exception { ValueMap properties = new ValueMapDecorator(map); new LetterPillarBoxImageTransformerImpl().transform(layer, properties); verifyNoInteractions(layer); }
@Test public void testTransform_nullParams() throws Exception { new LetterPillarBoxImageTransformerImpl().transform(layer, null); verifyNoInteractions(layer); }