code: private void delete(Geometry geometry, GeometryIndex index) throws GeometryIndexNotFoundException {
  		if (index.hasChild() && geometry.getGeometries() != null && geometry.getGeometries().length > index.getValue()
  				&& index.getValue() >= 0) {
  			delete(geometry.getGeometries()[index.getValue()], index.getChild());
  		} else if (index.getType() == GeometryIndexType.TYPE_GEOMETRY) {
  			if (geometry.getGeometries().length == 1) {
  				geometry.setGeometries(null);
  			} else {
  				Geometry[] result = new Geometry[geometry.getGeometries().length - 1];
  				int count = 0;
  				for (int i = 0; i < geometry.getGeometries().length; i++) {
  					if (i != index.getValue()) {
  						result[count] = geometry.getGeometries()[i];
  						count++;
  					}
  				}
  				geometry.setGeometries(result);
  			}
  
  		} else {
  			throw new GeometryIndexNotFoundException("Could not match index with given geometry");
  		}
  	}
docs: ------------------------------------------------------------------------