DefaultDataFunctionRegistry implements DataFunctionRegistry { @Override public void register(String name, DataFunction<?> function) { if (functions.containsKey(name)) { log.error("Cannot register a function with name " + name + " because that name is already taken"); throw new DuplicateFunctionException(name); } log.info("Registering function with name " + name); functions.put(name, function); } DefaultDataFunctionRegistry();  DefaultDataFunctionRegistry(boolean registerDefaults); @Override void register(String name, DataFunction<?> function); @Override DataFunction<?> getFunction(String name); @Override Set<String> getFunctions();  }
@Test(expectedExceptions = DuplicateFunctionException.class) public void testRegisteringDuplicateFunction() { final DefaultDataFunctionRegistry registry = new DefaultDataFunctionRegistry(); registry.register("count", new DeleteDataFunction()); }