@SuppressWarnings("unchecked")
    public @This @NonNull CommandManager<C> command(final @NonNull Command<? extends C> command) {
        if (!(this.transitionIfPossible(RegistrationState.BEFORE_REGISTRATION, RegistrationState.REGISTERING)
                || this.isCommandRegistrationAllowed())) {
            throw new IllegalStateException("Unable to register commands because the manager is no longer in a registration "
                    + "state. Your platform may allow unsafe registrations by enabling the appropriate manager setting.");
        }
        this.commandTree.insertCommand((Command<C>) command);
        this.commands.add((Command<C>) command);
        return this;
    }
Register a new command to the command manager and insert it into the underlying command tree. The command will be
forwarded to the {@link CommandRegistrationHandler} and will, depending on the platform, be forwarded to the platform.
<p>
Different command manager implementations have different requirements for the command registration. It is possible
that a command manager may only allow registration during certain stages of the application lifetime. Read the platform
command manager documentation to find out more about your particular platform

@param command Command to register
@return The command manager instance. This is returned so that these method calls may be chained. This will always
        return {@code this}.
cloud-core/src/main/java/org/incendo/cloud/CommandManager.java