@Test
  public void TestPolygonCentroid() throws Exception {
    final ST_Centroid stCtr = new ST_Centroid();
    final ST_Polygon stPoly = new ST_Polygon();
    BytesWritable bwGeom = stPoly.evaluate(new Text("polygon ((0 0, 0 8, 8 8, 8 0, 0 0))"));
    BytesWritable bwCentroid = stCtr.evaluate(bwGeom);
    validatePoint(new Point(4, 4), bwCentroid);
    bwGeom = stPoly.evaluate(new Text("polygon ((1 1, 5 1, 3 4, 1 1))"));
    bwCentroid = stCtr.evaluate(bwGeom);
    validatePoint(new Point(3, 2), bwCentroid);
    bwGeom = stPoly.evaluate(new Text("polygon ((14 0, -14 0, -2 24, 2 24, 14 0))"));
    bwCentroid = stCtr.evaluate(bwGeom);        // Cross-checked with ...
    validatePoint(new Point(0, 9), bwCentroid);  // ... omnicalculator.com/math/centroid
  }
Validates the centroid geometry writable.

@param point
           the represented point location.
@param geometryAsWritable
           the geometry represented as {@link BytesWritable}.
ql/src/test/org/apache/hadoop/hive/ql/udf/esri/TestStCentroid.java