code: public int getSiblingCount(Geometry geometry, GeometryIndex index) {
  		if (index.hasChild() && geometry.getGeometries() != null && 
  				geometry.getGeometries().length > index.getValue()) {
  			return getSiblingCount(geometry.getGeometries()[index.getValue()], index.getChild());
  		}
  		switch (index.getType()) {
  			case TYPE_VERTEX:
  				return geometry.getCoordinates() != null ? geometry.getCoordinates().length : 0;
  			case TYPE_EDGE:
  				if (Geometry.LINE_STRING.equals(geometry.getGeometryType())) {
  					int count = geometry.getCoordinates() != null ? geometry.getCoordinates().length - 1 : 0;
  					if (count < 0) {
  						count = 0;
  					}
  					return count;
  				} else if (Geometry.LINEAR_RING.equals(geometry.getGeometryType())) {
  					return geometry.getCoordinates() != null ? geometry.getCoordinates().length : 0;
  				}
  				return 0;
  			case TYPE_GEOMETRY:
  			default:
  				return geometry.getGeometries() != null ? geometry.getGeometries().length : 0;
  		}
  	}
docs: Given a certain index, how many indices of the same type can be found within the given geometry. This count
  includes the given index.<br>
  For example, if the index points to a vertex on a LinearRing within a polygon, then this will return the amount
  of vertices on that LinearRing.
  
  @param geometry
  The geometry to look into.
  @param index
  The index to take as example (can be of any type).
  @return Returns the total amount of siblings.