code: public static boolean isWithin(Geometry geometry, Coordinate coordinate) {
  		if (Geometry.MULTI_POLYGON.equals(geometry.getGeometryType())) {
  			for (int i = 0; i < geometry.getGeometries().length; i++) {
  				if (isWithin(geometry.getGeometries()[i], coordinate)) {
  					return true;
  				}
  			}
  		} else if (Geometry.POLYGON.equals(geometry.getGeometryType())) {
  			if (isWithinRing(geometry.getGeometries()[0], coordinate)) {
  				if (geometry.getGeometries().length > 1) {
  					for (int i = 1; i < geometry.getGeometries().length; i++) {
  						if (isWithinRing(geometry.getGeometries()[i], coordinate)) {
  							return false;
  						}
  					}
  				}
  				return true;
  			}
  		} else if (Geometry.LINEAR_RING.equals(geometry.getGeometryType())) {
  			return isWithinRing(geometry, coordinate);
  		}
  		return false;
  	}
docs: Is a certain coordinate within a given geometry?
  
  @param geometry The geometry to check against. Only geometries that contain closed rings can return true (i.e.
  LinearRing, Polygon, MultiPolygon).
  @param coordinate The position that is possibly within the geometry.
  @return Returns true if the coordinate is within the geometry.