code: public static boolean isSimple(Geometry geometry) {
  		if (isEmpty(geometry)) {
  			return true;
  		}
  		if (geometry.getGeometries() != null) {
  			for (Geometry child : geometry.getGeometries()) {
  				if (!isSimple(child)) {
  					return false;
  				}
  				if (Geometry.MULTI_LINE_STRING.equals(geometry.getGeometryType())) {
  					for (Geometry child2 : geometry.getGeometries()) {
  						if (child != child2 && intersects(child, child2)) {
  							return false;
  						}
  					}
  				}
  			}
  		}
  		if (geometry.getCoordinates() != null) {
  			List<Coordinate> coords1 = new ArrayList<Coordinate>();
  			List<Coordinate> coords2 = new ArrayList<Coordinate>();
  			getAllCoordinates(geometry, coords1);
  			getAllCoordinates(geometry, coords2);
  
  			// Search for any intersection:
  			if (coords1.size() > 1 && coords2.size() > 1) {
  				for (int i = 0; i < coords2.size() - 1; i++) {
  					for (int j = 0; j < coords1.size() - 1; j++) {
  						if ((i != j)
  								&& MathService.intersectsLineSegment(coords2.get(i), coords2.get(i + 1),
  										coords1.get(j), coords1.get(j + 1))) {
  							return false;
  						}
  					}
  				}
  			}
  		}
  		return true;
  	}
docs: Basically this function checks if the geometry is self-intersecting or not.
  
  @param geometry The geometry to check.
  @return True or false. True if there are no self-intersections in the geometry.