public static @NonNull CommandManager<TestCommandSender> createManager() {
        final CommandManager<TestCommandSender> manager = mock(
                TestCommandSenderCommandManager.class,
                withSettings().useConstructor(
                        ExecutionCoordinator.simpleCoordinator(),
                        CommandRegistrationHandler.nullCommandRegistrationHandler()
                ).defaultAnswer(Mockito.CALLS_REAL_METHODS)
        );

        // We don't care about the actual command meta.
        when(manager.createDefaultCommandMeta()).thenReturn(CommandMeta.empty());

        // The permission check should always return true, unless "no" is the parameter.
        when(manager.hasPermission(any(), anyString())).thenReturn(true);
        when(manager.hasPermission(any(), eq(FAILING_PERMISSION))).thenReturn(false);

        return manager;
    }
Creates a {@link CommandManager} that can be used for testing.

@return Mocked command manager.
cloud-core/src/test/java/org/incendo/cloud/util/TestUtils.java