docs: public void closePathWithBezier(Point2D controlPoint1, Point2D controlPoint2) {
  		_touch();
  		if (isEmptyImpl())
  			throw new GeometryException(
  					"Invalid call. This operation cannot be performed on an empty geometry.");
  
  		m_bPathStarted = false;
  
  		int pathIndex = m_paths.size() - 2;
  		byte pf = m_pathFlags.read(pathIndex);
  		m_pathFlags
  				.write(pathIndex,
  						(byte) (pf | PathFlags.enumClosed | PathFlags.enumHasNonlinearSegments));
  		_initSegmentData(6);
  
  		byte oldType = m_segmentFlags
  				.read((byte) ((m_pointCount - 1) & SegmentFlags.enumSegmentMask));
  		m_segmentFlags.write(m_pointCount - 1,
  				(byte) (SegmentFlags.enumBezierSeg));
  
  		int curveIndex = m_curveParamwritePoint;
  		if (getSegmentDataSize(oldType) < getSegmentDataSize((byte) SegmentFlags.enumBezierSeg)) {
  			m_segmentParamIndex.write(m_pointCount - 1, m_curveParamwritePoint);
  			m_curveParamwritePoint += 6;
  		} else {
  			// there was a closing bezier curve or an arc here. We can reuse the
  			// storage.
  			curveIndex = m_segmentParamIndex.read(m_pointCount - 1);
  		}
  
  		double z;
  		m_segmentParams.write(curveIndex, controlPoint1.x);
  		m_segmentParams.write(curveIndex + 1, controlPoint1.y);
  		z = 0;// TODO: calculate me.
  		m_segmentParams.write(curveIndex + 2, z);
  
  		m_segmentParams.write(curveIndex + 3, controlPoint2.x);
  		m_segmentParams.write(curveIndex + 4, controlPoint2.y);
  		z = 0;// TODO: calculate me.
  		m_segmentParams.write(curveIndex + 5, z);
  	}