class JTSUtilities {

    public static List<Polygon> splitOnAntimeridian(Polygon polygon, GeographicBoundingBox bounds, PolygonWinding winding)
    {
        if (polygon.getCoordinates().length < 3 || bounds != null && !bounds.crossesAntimeridian() || polygon.equals(WHOLE_GLOBE))
        {
            return Collections.singletonList(polygon);
        }

        if (bounds != null)
        {
            // We know the bounds and we know that this polygon crosses the
            // antimeridian.
            Polygon copy = (Polygon)polygon.clone();
            normalizeByBoundingBox(copy, bounds);
            return doDivideOnAntimeridian(copy);
        }
        if (winding == PolygonWinding.UNKNOWN)
        {
            Polygon copy = (Polygon)polygon.clone();
            boolean normalized = normalizeBySegmentLength(copy);
            if (normalized)
            {
                return doDivideOnAntimeridian(copy);
            }
            return Collections.singletonList(polygon);
        }
        // Get the natural winding. If this is different then the
        // winding we know we should have then we crossed the
        // antimeridian.
        PolygonWinding naturalWinding = getNaturalWinding(polygon.getExteriorRing().getCoordinates());
        if (naturalWinding.equals(winding))
        {
            return Collections.singletonList(polygon);
        }
        // TODO we can use the winding direction to determine the
        // interior of the polygon. We should be able to use this to
        // correctly normalize the polygon and allow for segments
        // longer than 180 degrees longitudinally.
        Polygon copy = (Polygon)polygon.clone();
        normalizeBySegmentLength(copy);
        return doDivideOnAntimeridian(copy);
    }

    private  JTSUtilities();

}