### Question:
Rectangle { public static String toString(double width, double height) { return String.format("Pravokutnik širine %.1f i visine %.1f ima površinu %.1f te opseg %.1f.", width, height, calculateArea(width, height), calculatePerimeter(width, height)); }  static void main(String[] args); static double promptArgument(String name, Scanner sc); static double calculateArea(double width, double height); static double calculatePerimeter(double width, double height); static String toString(double width, double height);  }### Answer:
@Test public void testToStringWithValidDimensions() { double width = 2; double height = 8; String correctString = "Pravokutnik širine 2.0 i visine 8.0 ima površinu 16.0 te opseg 20.0."; assertEquals(correctString, Rectangle.toString(width, height)); }
@Test public void testToStringWithNegativeWidth() { double width = -5; double height = 7; assertThrows(IllegalArgumentException.class, () -> Rectangle.toString(width, height)); }
@Test public void testToStringWithNegativeHeight() { double width = 5; double height = -7; assertThrows(IllegalArgumentException.class, () -> Rectangle.toString(width, height)); }