AreaCalculator { public static int calulateArea(Rectangle rectangle) { return rectangle.getHeight() * rectangle.getWidth(); }  static int calulateArea(Rectangle rectangle); static int calulateArea(Square square);  }
@Test public void sixFor2x3Rectangle() throws Exception { Rectangle rectangle = new Rectangle(); rectangle.setHeight(2); rectangle.setWidth(3); assertEquals(6, AreaCalculator.calulateArea(rectangle)); }
@Test public void nineFor3x3Square() throws Exception { Square square = new Square(); square.setHeight(3); assertEquals(9, AreaCalculator.calulateArea(square)); }
@Test public void twentyFor4x5RectangleFromSquare() throws Exception { Rectangle square = new Square(); square.setHeight(5); square.setWidth(4); assertEquals(20, AreaCalculator.calulateArea(square)); }