code: public static boolean isWithin(Geometry geometry, Coordinate coordinate) {
  		if (geometry instanceof MultiPolygon) {
  			for (int i = 0; i < geometry.getNumGeometries(); i++) {
  				if (isWithin(geometry.getGeometryN(i), coordinate)) {
  					return true;
  				}
  			}
  		} else if (geometry instanceof Polygon) {
  			Polygon polygon = (Polygon) geometry;
  			if (isWithinRing(polygon.getExteriorRing(), coordinate)) {
  				for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
  					if (isWithinRing(polygon.getInteriorRingN(i), coordinate)) {
  						return false;
  					}
  				}
  				return true;
  			}
  		} else if (geometry instanceof LinearRing) {
  			return isWithinRing((LinearRing) geometry, coordinate);
  		}
  		return false;
  	}
docs: Is a certain coordinate within a given geometry?
  
  @param geometry
  The geometry to check against. Only if it has {@link LinearRing}'s, can the coordinate be inside.
  @param coordinate
  The position that is possibly within the geometry.
  @return Returns true if the coordinate is within the geometry.