public synchronized void userAddFunction(Function f, boolean allowExists) throws UserException {
        addFunction(f, false, allowExists);
        GlobalStateMgr.getCurrentState().getEditLog().logAddFunction(f);
    }
@Test
    public void testUserAddFunctionGivenFunctionAlreadyExists() throws UserException {
        FunctionName name = new FunctionName(null, "addIntInt");
        name.setAsGlobalFunction();
        final Type[] argTypes = {Type.INT, Type.INT};
        Function f = new Function(name, argTypes, Type.INT, false);

        // Add the UDF for the first time
        globalFunctionMgr.userAddFunction(f, false);

        // Attempt to add the same UDF again, expecting an exception
        Assert.assertThrows(UserException.class, () -> globalFunctionMgr.userAddFunction(f, false));
    }