### Question:
ShapeFiller { public void fill(Canvas graphics) { graphics.setColor(color); graphics.fill(new TransformedShape(shape)); } ShapeFiller(AgnosticShape shape, RGBColor color); void fill(Canvas graphics);  }### Answer:
@Test public void fillsPolygonWithColor() throws Exception { Canvas graphics = mock(Canvas.class); Polygon polygon = new Polygon(); RGBColor color = RGBColor.White; new ShapeFiller(polygon, color).fill(graphics); InOrder inOrder = inOrder(graphics); inOrder.verify(graphics).setColor(color); inOrder.verify(graphics).fill(new TransformedShape(polygon)); }