    @Test
    public void testPrecedingThresholds() throws Exception {

        System.out.println("   testPrecedingThresholds");

        final String[] categories = {"low", "mid", "high", "super"};
        final Double[] thresholds = {0.0, 50.0, 100.0};
        setupParameters(categories, thresholds);
        parameters.add(ff2.literal("preceding"));

        Function fn = finder.findFunction("categorize", parameters);

        String result;
        int i;
        for (i = 0 ;i < thresholds.length; i++) {
            // below threshold: should be in category i
            result = fn.evaluate(feature(thresholds[i].intValue() - 1), String.class);
            assertEquals(categories[i], result);

            // at threshold boundary: should still be in category i
            result = fn.evaluate(feature(thresholds[i].intValue()), String.class);
            assertEquals(categories[i], result);
        }

        // above last threshold
        result = fn.evaluate(feature(thresholds[thresholds.length - 1].intValue() + 1), String.class);
        assertEquals(categories[categories.length - 1], result);
    }