java.awt.Polygon.inside is deprecated. Show me a refactoring example
The `java.awt.Polygon.inside(int x, int y)` method has been deprecated in Java. Instead, you can use the `contains(int x, int y)` method to check if a point is inside the polygon. Here’s how you can refactor your code to replace the deprecated `inside` method with `contains`.

### Example Before Refactoring

Here's an example of using the deprecated `inside` method:

```java
import java.awt.Polygon;

public class PolygonExample {
    public static void main(String[] args) {
        Polygon polygon = new Polygon();
        polygon.addPoint(0, 0);
        polygon.addPoint(100, 0);
        polygon.addPoint(100, 100);
        polygon.addPoint(0, 100);

        int x = 50;
        int y = 50;

        if (polygon.inside(x, y)) {
            System.out.println("Point is inside the polygon.");
        } else {
            System.out.println("Point is outside the polygon.");
        }
    }
}
```

### Refactored Example

Here’s how you can refactor the above code to use `contains` instead:

```java
import java.awt.Polygon;

public class PolygonExample {
    public static void main(String[] args) {
        Polygon polygon = new Polygon();
        polygon.addPoint(0, 0);
        polygon.addPoint(100, 0);
        polygon.addPoint(100, 100);
        polygon
Polygon polygon = new Polygon(new int[]{10, 20, 30, 40});
polygon.setPoints(new int[]{15, 25, 35, 45});

// Refactoring example
polygon.setPoints(new int[]{10, 20, 30, 40});
polygon.setPoints(new int[]{15, 25, 35, 45});
// Changed the points of the polygon but kept the same shape
// by using the same number of points and the same order
// of points

// Output: 
// Polygon {x=10, y=20, x=15, y=25, x=30, y=35, x=40, y=45}