Intuitively, every square is a rectangle, so it is tempting to use inheritance for implementing a square:

public class Square extends Rectangle 

However, the devil is in the details. The Square class inherits all mutators of Rectangle, and some of them can mutate a square into a non-square shape. All these mutators need to be reimplemented so that they ensure that no such mutation occurs.

Your task is to implement the Square constructor and one mutator, the setSize method. In the setSize method, you should use the assert operator to check that the new size is again a square.