@Test
    void emptyCommandTreeThrowsNoSuchCommandException() {
        // Arrange
        final TestCommandSender commandSender = new TestCommandSender();
        final CommandManager<TestCommandSender> commandManager = createManager();
        final CommandTree<TestCommandSender> commandTree = CommandTree.newTree(commandManager);
        final CommandInput commandInput = CommandInput.of("test this thing");

        // Act
        final CompletionException exception = Assertions.assertThrows(
                CompletionException.class,
                () -> commandTree.parse(new CommandContext<>(commandSender, commandManager), commandInput,
                        ExecutionCoordinator.nonSchedulingExecutor()).join()
        );

        // Assert
        assertThat(exception).hasCauseThat().isInstanceOf(NoSuchCommandException.class);
        final NoSuchCommandException noSuchCommandException = (NoSuchCommandException) exception.getCause();
        assertThat(noSuchCommandException.suppliedCommand()).isEqualTo("test");
        assertThat(noSuchCommandException).hasCauseThat().isNull();
    }
Test for https://github.com/Incendo/cloud/issues/337.
cloud-core/src/test/java/org/incendo/cloud/issue/Issue337.java