docs: static protected int isSimpleAsFeature(/* const */Geometry geometry, /* const */
  	SpatialReference spatialReference, boolean bForce, NonSimpleResult result,
  			ProgressTracker progressTracker) {
  		if (result != null) {
  			result.m_reason = NonSimpleResult.Reason.NotDetermined;
  			result.m_vertexIndex1 = -1;
  			result.m_vertexIndex2 = -1;
  		}
  		if (geometry.isEmpty())
  			return 1;
  		Geometry.Type gt = geometry.getType();
  		if (gt == Geometry.Type.Point)
  			return 1;
  
  		double tolerance = InternalUtils.calculateToleranceFromGeometry(
  				spatialReference, geometry, false);
  		if (gt == Geometry.Type.Envelope) {
  			/* const */Envelope env = (Envelope) geometry;
  			Envelope2D env2D = new Envelope2D();
  			env.queryEnvelope2D(env2D);
  			if (env2D.isDegenerate(tolerance)) {
  				if (result != null) {
  					result.m_reason = NonSimpleResult.Reason.DegenerateSegments;
  					result.m_vertexIndex1 = -1;
  					result.m_vertexIndex2 = -1;
  				}
  				return 0;
  			}
  			return 1;
  		} else if (Geometry.isSegment(gt.value())) {
  			/* const */Segment seg = (Segment) geometry;
  			Polyline polyline = new Polyline(seg.getDescription());
  			polyline.addSegment(seg, true);
  			return isSimpleAsFeature(polyline, spatialReference, bForce,
  					result, progressTracker);
  		}
  
  		// double geomTolerance = 0;
  		int isSimple = ((MultiVertexGeometryImpl) geometry._getImpl())
  				.getIsSimple(tolerance);
  		int knownSimpleResult = bForce ? -1 : isSimple;
  		// TODO: need to distinguish KnownSimple between SimpleAsFeature and
  		// SimplePlanar.
  		// From the first sight it seems the SimplePlanar implies
  		// SimpleAsFeature.
  		if (knownSimpleResult != -1)
  			return knownSimpleResult;
  
  		OperatorSimplifyLocalHelper helper = new OperatorSimplifyLocalHelper(
  				geometry, spatialReference, knownSimpleResult, progressTracker,
  				false);
  
  		if (gt == Geometry.Type.MultiPoint) {
  			knownSimpleResult = helper.multiPointIsSimpleAsFeature_();
  		} else if (gt == Geometry.Type.Polyline) {
  			knownSimpleResult = helper.polylineIsSimpleAsFeature_();
  		} else if (gt == Geometry.Type.Polygon) {
  			knownSimpleResult = helper.polygonIsSimpleAsFeature_();
  		} else {
  			throw GeometryException.GeometryInternalError();// what else?
  		}
  
  		((MultiVertexGeometryImpl) (geometry._getImpl())).setIsSimple(
  				knownSimpleResult, tolerance, false);
  		if (result != null && knownSimpleResult == 0)
  			result.Assign(helper.m_nonSimpleResult);
  		return knownSimpleResult;
  	}