public Set<String> listFunctions() {
        return usedModules.stream()
                .map(name -> loadedModules.get(name).listFunctions(false))
                .flatMap(Collection::stream)
                .collect(Collectors.toSet());
    }
@Test
    void testListFunctions() {
        ModuleMock x = new ModuleMock("x");
        manager.loadModule(x.getType(), x);

        assertThat(manager.listFunctions()).contains(ModuleMock.DUMMY_FUNCTION_NAME);

        // hidden functions not in the default list
        assertThat(manager.listFunctions()).doesNotContain(ModuleMock.INTERNAL_FUNCTION_NAME);

        // should not return function name of an unused module
        manager.useModules(CoreModuleFactory.IDENTIFIER);
        assertThat(manager.listFunctions()).doesNotContain(ModuleMock.DUMMY_FUNCTION_NAME);
    }