There is a task:
public void enlarge(int nx, int ny) Increases the sides of the Rectangle by (nx, ny) times while maintaining the coordinates of the left upper vertex.
There is a test class to check:
public class TestRectangle { @Test public void testEnlargeRectangle() { Rectangle rect = new Rectangle(10, 20, 30, 40); rect.enlarge(3, 5); assertEquals(10, rect.getTopLeft().getX()); assertEquals(20, rect.getTopLeft().getY()); assertEquals(70, rect.getBottomRight().getX()); assertEquals(120, rect.getBottomRight().getY()); } } I honestly do not fully understand the task. I need to leave the top left vertex in place and just move the bottom right corner of the rectangle, and as a result it will stretch. How to figure it out?