FunctionLoader { public static Set<FunctionDesc> findScalarFunctions() { Set<FunctionDesc> functions = Sets.newHashSet(); Set<Method> scalarFunctions = findPublicStaticMethods("org.apache.tajo.engine.function", new Predicate() { @Override public boolean evaluate(Object object) { return ((Method) object).getAnnotation(ScalarFunction.class) != null; } }); for (Method method : scalarFunctions) { ScalarFunction annotation = method.getAnnotation(ScalarFunction.class); functions.addAll(buildFunctionDescs(annotation, method)); } return functions; }  static Map<FunctionSignature, FunctionDesc> load(); static Map<FunctionSignature, FunctionDesc> loadUserDefinedFunctions(TajoConf conf,
                                                                              Map<FunctionSignature, FunctionDesc> functionMap); static Set<FunctionDesc> findScalarFunctions(); static List<FunctionDesc> findLegacyFunctions(); static final String PYTHON_FUNCTION_NAMESPACE; }
@Test public void testFindScalarFunctions() throws IOException { List<FunctionDesc> collections = Lists.newArrayList(FunctionLoader.findScalarFunctions()); Collections.sort(collections); String functionList = StringUtils.join(collections, "\n"); String result = getResultText(TestFunctionLoader.class, "testFindScalarFunctions.result"); assertEquals(result.trim(), functionList.trim()); }