I have a polygon and a line segment which has its endpoints on two sides of the polygon. What is the easiest way to split the polygon into two polygons. (I am using the jts package).

I have tried using polygonizer but I don't think that I am using it correctly because it doesn't seem to be working.

Thanks,