// Path: sshd-shell-spring-boot-starter/src/main/java/sshd/shell/springboot/ShellException.java
// public class ShellException extends Exception {
// 
//     private static final long serialVersionUID = 7114130906989289480L;
// 
//     public ShellException(String message) {
//         super(message);
//     }
// 
//     public ShellException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: sshd-shell-spring-boot-starter/src/main/java/sshd/shell/springboot/command/AbstractSystemCommand.java
// public abstract class AbstractSystemCommand {
// 
//     private final Set<String> systemRoles;
// 
//     public AbstractSystemCommand(String[] systemRoles) {
//         this.systemRoles = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(systemRoles)));
//     }
// 
//     public final Set<String> getSystemRoles() {
//         return systemRoles;
//     }
// }


import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;
import java.util.stream.Collectors;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.Assert;
import sshd.shell.springboot.ShellException;
import sshd.shell.springboot.command.AbstractSystemCommand;
    }

    private Map<String, CommandExecutableDetails> getSupplierMap(SshdShellCommand annotation,
            Map<String, Map<String, CommandExecutableDetails>> sshdShellCommandsMap) {
        Map<String, CommandExecutableDetails> map = sshdShellCommandsMap.get(annotation.value());
        Assert.isTrue(Objects.isNull(map), "Duplicate commands in different classes are not allowed");
        sshdShellCommandsMap.put(annotation.value(), map = new TreeMap<>());
        return map;
    }

    private void loadSshdShellCommandSuppliers(Class<?> clazz, SshdShellCommand annotation,
            Map<String, CommandExecutableDetails> map, Object obj) {
        loadClassLevelCommandSupplier(clazz, annotation, map, obj);
        loadMethodLevelCommandSupplier(clazz, map, obj);
    }

    private void loadClassLevelCommandSupplier(Class<?> clazz, SshdShellCommand annotation,
            Map<String, CommandExecutableDetails> map, Object obj) {
        log.debug("Loading class level command supplier for {}", clazz.getName());
        try {
            Method method = clazz.getDeclaredMethod(annotation.value(), String.class);
            map.put(Constants.EXECUTE, getMethodSupplier(annotation, obj, buildCommandExecutable(method, obj)));
        } catch (NoSuchMethodException ex) {
            map.put(Constants.EXECUTE, getMethodSupplier(annotation, obj, null));
        }
    }

    private CommandExecutableDetails getMethodSupplier(SshdShellCommand annotation, Object obj,
            CommandExecutor commandExecutor) {
        CommandExecutableDetails ced = new CommandExecutableDetails(annotation,
// Path: sshd-shell-spring-boot-starter/src/main/java/sshd/shell/springboot/ShellException.java
// public class ShellException extends Exception {
// 
//     private static final long serialVersionUID = 7114130906989289480L;
// 
//     public ShellException(String message) {
//         super(message);
//     }
// 
//     public ShellException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: sshd-shell-spring-boot-starter/src/main/java/sshd/shell/springboot/command/AbstractSystemCommand.java
// public abstract class AbstractSystemCommand {
// 
//     private final Set<String> systemRoles;
// 
//     public AbstractSystemCommand(String[] systemRoles) {
//         this.systemRoles = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(systemRoles)));
//     }
// 
//     public final Set<String> getSystemRoles() {
//         return systemRoles;
//     }
// }


// Path: sshd-shell-spring-boot-starter/src/main/java/sshd/shell/springboot/autoconfiguration/SshdShellAutoConfiguration.java
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;
import java.util.stream.Collectors;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.Assert;
import sshd.shell.springboot.ShellException;
import sshd.shell.springboot.command.AbstractSystemCommand;

    }

    private Map<String, CommandExecutableDetails> getSupplierMap(SshdShellCommand annotation,
            Map<String, Map<String, CommandExecutableDetails>> sshdShellCommandsMap) {
        Map<String, CommandExecutableDetails> map = sshdShellCommandsMap.get(annotation.value());
        Assert.isTrue(Objects.isNull(map), "Duplicate commands in different classes are not allowed");
        sshdShellCommandsMap.put(annotation.value(), map = new TreeMap<>());
        return map;
    }

    private void loadSshdShellCommandSuppliers(Class<?> clazz, SshdShellCommand annotation,
            Map<String, CommandExecutableDetails> map, Object obj) {
        loadClassLevelCommandSupplier(clazz, annotation, map, obj);
        loadMethodLevelCommandSupplier(clazz, map, obj);
    }

    private void loadClassLevelCommandSupplier(Class<?> clazz, SshdShellCommand annotation,
            Map<String, CommandExecutableDetails> map, Object obj) {
        log.debug("Loading class level command supplier for {}", clazz.getName());
        try {
            Method method = clazz.getDeclaredMethod(annotation.value(), String.class);
            map.put(Constants.EXECUTE, getMethodSupplier(annotation, obj, buildCommandExecutable(method, obj)));
        } catch (NoSuchMethodException ex) {
            map.put(Constants.EXECUTE, getMethodSupplier(annotation, obj, null));
        }
    }

    private CommandExecutableDetails getMethodSupplier(SshdShellCommand annotation, Object obj,
            CommandExecutor commandExecutor) {
        CommandExecutableDetails ced = new CommandExecutableDetails(annotation,
                obj instanceof AbstractSystemCommand