List<Coordinate2D> firstLinePts = new List<Coordinate2D>();
firstLinePts.Add(new Coordinate2D(1.0, 1.0));
firstLinePts.Add(new Coordinate2D(1.0, 4.0));
List<Coordinate2D> secondLinePts = new List<Coordinate2D>();
secondLinePts.Add(new Coordinate2D(4.0, 4.0));
secondLinePts.Add(new Coordinate2D(4.0, 1.0));
List<Coordinate2D> thirdLinePts = new List<Coordinate2D>();
thirdLinePts.Add(new Coordinate2D(0.0, 2.0));
thirdLinePts.Add(new Coordinate2D(5.0, 2.0));
List<Coordinate2D> fourthLinePts = new List<Coordinate2D>();
fourthLinePts.Add(new Coordinate2D(0.0, 3.0));
fourthLinePts.Add(new Coordinate2D(5.0, 3.0));
// build the polylines
List<Polyline> polylines = new List<Polyline>();
polylines.Add(PolylineBuilder.CreatePolyline(firstLinePts));
polylines.Add(PolylineBuilder.CreatePolyline(secondLinePts));
polylines.Add(PolylineBuilder.CreatePolyline(thirdLinePts));
polylines.Add(PolylineBuilder.CreatePolyline(fourthLinePts));
// construct polygons from the polylines
var polygons = GeometryEngine.Instance.ConstructPolygonsFromPolylines(polylines);
// polygons.Count = 1
// polygon coordinates are (1.0, 2.0), (1.0, 3.0), (4.0, 3.0), (4.0, 2.0)