private static void validatePoint(Point point, BytesWritable geometryAsWritable) {
    ST_X getX = new ST_X();
    ST_Y getY = new ST_Y();
    DoubleWritable xAsWritable = getX.evaluate(geometryAsWritable);
    DoubleWritable yAsWritable = getY.evaluate(geometryAsWritable);

    if (null == xAsWritable || null == yAsWritable || Math.abs(point.getX() - xAsWritable.get()) > Epsilon
        || Math.abs(point.getY() - yAsWritable.get()) > Epsilon)
      System.err.println("validateCentroid: " + (new ST_AsText()).evaluate(geometryAsWritable) + " ~ " + point);

    assertNotNull("The x writable must not be null!", xAsWritable);
    assertNotNull("The y writable must not be null!", yAsWritable);
    assertEquals("Longitude is different!", point.getX(), xAsWritable.get(), Epsilon);
    assertEquals("Latitude is different!", point.getY(), yAsWritable.get(), Epsilon);
  }
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