class GeoUtils {

    public static boolean checkPointWithMultiPolygon( double longitude, double latitude,
        Geometry geometry )
    {
        try
        {
            boolean contains = false;

            Point point = getGeoJsonPoint( longitude, latitude );

            FeatureType featureType = FeatureType.getTypeFromName(geometry.getGeometryType());

            if ( point != null && point.isValid() )
            {
                if ( featureType == FeatureType.POLYGON )
                {
                    Polygon polygon = (Polygon) geometry;
                    contains = polygon.contains( point );
                }
                else if ( featureType == FeatureType.MULTI_POLYGON )
                {
                    MultiPolygon multiPolygon = (MultiPolygon) geometry;
                    contains = multiPolygon.contains( point );
                }
            }

            return contains;
        }
        catch ( Exception ex )
        {
            return false;
        }
    }

}