code: public boolean isSimple() {
  		if (isEmpty()) {
  			return true;
  		}
  
  		if (getNumGeometries() > 1) {
  			for (int n = 0; n < getNumGeometries(); n++) {
  				if (!getGeometryN(n).isSimple()) {
  					return false;
  				}
  			}
  		} else {
  			final Coordinate[] coords1 = getCoordinates();
  			final Coordinate[] coords2 = getCoordinates();
  			if (coords1.length > 1 && coords2.length > 1) {
  				for (int i = 0; i < coords2.length - 1; i++) {
  					for (int j = 0; j < coords1.length - 1; j++) {
  						if (Mathlib.lineIntersects(coords2[i], coords2[i + 1], coords1[j], coords1[j + 1])) {
  							return false;
  						}
  					}
  				}
  			} else {
  				// TODO implement me
  			}
  		}
  
  		return true;
  	}
docs: Basically this function checks if the geometry is self-intersecting or not.
  
  @return True or false. True if there are no self-intersections in the geometry.