code: private GeometryIndex recursiveCreate(GeometryIndex index, int lastValue, GeometryIndexType lastType) {
  		if (index.hasChild()) {
  			return new GeometryIndex(index.getType(), index.getValue(), recursiveCreate(index.getChild(), lastValue,
  					lastType));
  		} else {
  			GeometryIndexType type = lastType == null ? index.getType() : lastType;
  			return new GeometryIndex(type, lastValue, null);
  		}
  	}
docs: ------------------------------------------------------------------------