@Test
  public void TestLineCentroid() throws Exception {
    final ST_Centroid stCtr = new ST_Centroid();
    final ST_LineString stLn = new ST_LineString();
    BytesWritable bwGeom = stLn.evaluate(new Text("linestring (0 0, 6 0)"));
    BytesWritable bwCentroid = stCtr.evaluate(bwGeom);
    validatePoint(new Point(3, 0), bwCentroid);
    bwGeom = stLn.evaluate(new Text("linestring (0 0, 0 4, 12 4)"));
    bwCentroid = stCtr.evaluate(bwGeom);
    // L1 = 4, L2 = 12, W1 = 0.25, W2 = 0.75, X = W1 * 0 + W2 * 6, Y = W1 * 2 + W2 * 4
    // Or like centroid of multipoint of 1 of (0 2) and 3 of (6 4)
    validatePoint(new Point(4.5, 3.5), bwCentroid);
  }
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