### Question:
Bar implements Renderable { public Bar(int width, int height) { super(); maxWidth = width; maxHeight = height; } Bar(int width, int height); @Override void render(Graphic g); void setHorizontalReferential(boolean leftRight); void setVerticalReferential(boolean upDown); void setBorderSize(int hBorder, int vBorder); void setColor(ColorRgba background, ColorRgba foreground); void setColorBackground(ColorRgba color); void setColorForeground(ColorRgba color); void setColorGradient(ColorRgba color1, ColorRgba color2); void setColorGradient(int x1, int y1, ColorRgba color1, int x2, int y2, ColorRgba color2); void setLocation(int x, int y); void setMaximumSize(int width, int height); void setWidthPercent(int widthPercent); void setHeightPercent(int heightPercent); int getWidth(); int getHeight(); int getWidthPercent(); int getHeightPercent(); int getWidthMax(); int getHeightMax();  }### Answer:
@Test void testBar() { final Graphic g = new GraphicMock(); final Bar bar = new Bar(10, 20); bar.setBorderSize(1, 1); bar.setColorBackground(ColorRgba.WHITE); bar.setColorForeground(ColorRgba.BLACK); bar.setLocation(0, 0); bar.setMaximumSize(10, 20); bar.setVerticalReferential(true); bar.setHorizontalReferential(true); bar.setWidthPercent(100); bar.setHeightPercent(100); assertEquals(10, bar.getWidthMax()); assertEquals(20, bar.getHeightMax()); assertEquals(100, bar.getWidthPercent()); assertEquals(100, bar.getHeightPercent()); assertEquals(10, bar.getWidth()); assertEquals(20, bar.getHeight()); bar.setWidthPercent(50); bar.setHeightPercent(50); assertEquals(50, bar.getWidthPercent()); assertEquals(50, bar.getHeightPercent()); assertEquals(5, bar.getWidth()); assertEquals(10, bar.getHeight()); bar.render(g); bar.setColorBackground(null); bar.setVerticalReferential(false); bar.setHorizontalReferential(true); bar.render(g); bar.setColorBackground(ColorRgba.WHITE); bar.setColorForeground(null); bar.setVerticalReferential(false); bar.setHorizontalReferential(false); bar.render(g); bar.setColor(null, null); bar.setVerticalReferential(true); bar.setHorizontalReferential(false); bar.render(g); bar.setWidthPercent(100); bar.setHeightPercent(0); bar.render(g); bar.setWidthPercent(0); bar.setHeightPercent(100); bar.render(g); bar.setWidthPercent(100); bar.setHeightPercent(100); bar.setColorGradient(0, 0, ColorRgba.WHITE, 50, 10, ColorRgba.BLACK); bar.render(g); bar.setColorGradient(ColorRgba.WHITE, ColorRgba.BLACK); bar.render(g); }