result = (Shape) line.clone();
}
// RectangularShape includes: Arc2D, Ellipse2D, Rectangle2D, RoundRectangle2D.
else if (shape instanceof RectangularShape) {
RectangularShape rectangle = (RectangularShape) shape;
result = (Shape) rectangle.clone();
}
else if (shape instanceof Area) {
Area area = (Area) shape;
result = (Shape) area.clone();
}