@Test public void theLastFunctionIsUsedWhenThereAreDuplicatedNames() { FunctionRegistry customRegistry = new FunctionRegistry( new TestFunction("foo", ArgumentConstraints.typeOf(JmesPathType.STRING)), new TestFunction("foo", ArgumentConstraints.typeOf(JmesPathType.NUMBER)) ); Function function = customRegistry.getFunction("foo"); Object result = function.call(runtime, createValueArguments(3L)); assertThat(result, is((Object) 3L)); }
public Function getFunction(String functionName) { return functions.get(functionName); }
FunctionRegistry { public Function getFunction(String functionName) { return functions.get(functionName); } }
FunctionRegistry { public Function getFunction(String functionName) { return functions.get(functionName); } FunctionRegistry(Function... functions); private  FunctionRegistry(Map<String, Function> functions0, Function... functions1); }
FunctionRegistry { public Function getFunction(String functionName) { return functions.get(functionName); } FunctionRegistry(Function... functions); private  FunctionRegistry(Map<String, Function> functions0, Function... functions1); static FunctionRegistry defaultRegistry(); Function getFunction(String functionName); FunctionRegistry extend(Function... functions); }
FunctionRegistry { public Function getFunction(String functionName) { return functions.get(functionName); } FunctionRegistry(Function... functions); private  FunctionRegistry(Map<String, Function> functions0, Function... functions1); static FunctionRegistry defaultRegistry(); Function getFunction(String functionName); FunctionRegistry extend(Function... functions);  }