RecodeFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } RecodeFunction();  RecodeFunction(List<Expression> parameters, Literal fallback); String getName(); FunctionName getFunctionName(); List<Expression> getParameters(); Object accept(ExpressionVisitor visitor, Object extraData); Object evaluate(Object object); T evaluate(Object object, Class<T> context); Literal getFallbackValue(); static final FunctionName NAME; }
@Test public void testCaseInsensitiveLookup() throws Exception { System.out.println(" testCaseInsensitiveLookup"); setupParameters(words, ints); Function fn = finder.findFunction("recode", parameters); for (int i = 0; i < words.length; i++) { assertEquals(ints[i], fn.evaluate(feature(words[i].toLowerCase()), Integer.class)); assertEquals(ints[i], fn.evaluate(feature(words[i].toUpperCase()), Integer.class)); } }