class SpatialRuleLookupJTS implements SpatialRuleLookup {

    @Override
    public SpatialRule lookupRule(double lat, double lon) {
        if (!maxBounds.covers(lon, lat)) {
            return SpatialRule.EMPTY;
        }

        Envelope searchEnv = new Envelope(lon, lon, lat, lat);
        
        @SuppressWarnings("unchecked")
        List<SpatialRuleContainer> containers = index.query(searchEnv);
        
        if (containers.isEmpty()) {
            return SpatialRule.EMPTY;
        }
        
        Point point = geometryFactory.createPoint(new Coordinate(lon, lat));
        List<SpatialRule> applicableRules = new ArrayList<>();
        for (SpatialRuleContainer container : containers) {
            if (container.containsProperly(point)) {
                applicableRules.addAll(container.getRules());
            }
        }
        
        if (applicableRules.isEmpty()) {
            return SpatialRule.EMPTY;
        }

        //TODO support multiple rules
        return applicableRules.get(0);
    }

    public  SpatialRuleLookupJTS(List<SpatialRule> spatialRules, Envelope maxBounds);

}