code: public String getGeometryType(Geometry geometry, GeometryIndex index) throws GeometryIndexNotFoundException {
  		if (index != null && index.getType() == GeometryIndexType.TYPE_GEOMETRY) {
  			if (geometry.getGeometries() != null && geometry.getGeometries().length > index.getValue()) {
  				return getGeometryType(geometry.getGeometries()[index.getValue()], index.getChild());
  			} else {
  				throw new GeometryIndexNotFoundException("Can't find the geometry referred to in the given index.");
  			}
  		}
  		return geometry.getGeometryType();
  	}
docs: What is the geometry type of the sub-geometry pointed to by the given index? If the index points to a vertex or
  edge, the geometry type at the parent level is returned.
  
  @param geometry
  The geometry wherein to search.
  @param index
  The index pointing to a vertex/edge/sub-geometry. In the case of a vertex/edge, the parent geometry
  type is returned. If index is null, the type of the given geometry is returned.
  @return The geometry type as defined in the {@link Geometry} class.
  @throws GeometryIndexNotFoundException
  Thrown in case the index points to a non-existing sub-geometry.