code: public Coordinate[] getEdge(Geometry geometry, GeometryIndex index) throws GeometryIndexNotFoundException {
  		if (index.hasChild()) {
  			if (geometry.getGeometries() != null && geometry.getGeometries().length > index.getValue()) {
  				return getEdge(geometry.getGeometries()[index.getValue()], index.getChild());
  			}
  			throw new GeometryIndexNotFoundException("Could not match index with given geometry");
  		}
  		if (index.getType() == GeometryIndexType.TYPE_EDGE && geometry.getCoordinates() != null
  				&& geometry.getCoordinates().length > (index.getValue() - 1)) {
  			return new Coordinate[] { geometry.getCoordinates()[index.getValue()],
  					geometry.getCoordinates()[index.getValue() + 1] };
  		}
  		throw new GeometryIndexNotFoundException("Could not match index with given geometry");
  	}
docs: Given a certain geometry, get the edge the index points to. This only works if the index actually points to an
  edge.
  
  @param geometry
  The geometry to search in.
  @param index
  The index that points to an edge within the given geometry.
  @return Returns the edge if it exists.
  @throws GeometryIndexNotFoundException
  Thrown in case the index is of the wrong type, or if the edge could not be found within the given
  geometry.