// Path: src/main/java/com/github/jankroken/commandline/domain/InvalidCommandLineException.java
// public class InvalidCommandLineException extends CommandLineException {
//     private static final long serialVersionUID = 2L;
// 
//     public InvalidCommandLineException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/com/github/jankroken/commandline/domain/UnrecognizedSwitchException.java
// public class UnrecognizedSwitchException extends CommandLineException {
//     private static final long serialVersionUID = 2L;
//     private String _switch;
// 
//     public UnrecognizedSwitchException(Class<?> configurationClass, String _switch) {
//         super(configurationClass + ": " + _switch);
//         this._switch = _switch;
//     }
// 
//     public String getSwitch() {
//         return _switch;
//     }
// }


import com.github.jankroken.commandline.domain.InvalidCommandLineException;
import com.github.jankroken.commandline.domain.UnrecognizedSwitchException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
                return optionSpecification;
            }
        }
        return null;
    }

    public void consumeOptions(Tokenizer args)
            throws IllegalAccessException, InvocationTargetException, InstantiationException {
        while (args.hasNext()) {
            if (args.peek() instanceof SwitchToken) {
                var optionSpecification = getOptionSpecification((SwitchToken) args.peek());
                if (optionSpecification == null) {
                    switch (optionSetLevel) {
                        case MAIN_OPTIONS:
                            throw new UnrecognizedSwitchException(spec.getClass(), args.peek().getValue());
                        case SUB_GROUP:
                            validateAndConsolidate();
                            return;
                    }
                } else {
                    args.next();
                    optionSpecification.activateAndConsumeArguments(args);
                }
            } else {
                var looseArgsOptionSpecification = getLooseArgsOptionSpecification();
                if (looseArgsOptionSpecification != null) {
                    looseArgsOptionSpecification.activateAndConsumeArguments(args);
                } else {
                    switch (optionSetLevel) {
                        case MAIN_OPTIONS:
// Path: src/main/java/com/github/jankroken/commandline/domain/InvalidCommandLineException.java
// public class InvalidCommandLineException extends CommandLineException {
//     private static final long serialVersionUID = 2L;
// 
//     public InvalidCommandLineException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/com/github/jankroken/commandline/domain/UnrecognizedSwitchException.java
// public class UnrecognizedSwitchException extends CommandLineException {
//     private static final long serialVersionUID = 2L;
//     private String _switch;
// 
//     public UnrecognizedSwitchException(Class<?> configurationClass, String _switch) {
//         super(configurationClass + ": " + _switch);
//         this._switch = _switch;
//     }
// 
//     public String getSwitch() {
//         return _switch;
//     }
// }


// Path: src/main/java/com/github/jankroken/commandline/domain/internal/OptionSet.java
import com.github.jankroken.commandline.domain.InvalidCommandLineException;
import com.github.jankroken.commandline.domain.UnrecognizedSwitchException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

                return optionSpecification;
            }
        }
        return null;
    }

    public void consumeOptions(Tokenizer args)
            throws IllegalAccessException, InvocationTargetException, InstantiationException {
        while (args.hasNext()) {
            if (args.peek() instanceof SwitchToken) {
                var optionSpecification = getOptionSpecification((SwitchToken) args.peek());
                if (optionSpecification == null) {
                    switch (optionSetLevel) {
                        case MAIN_OPTIONS:
                            throw new UnrecognizedSwitchException(spec.getClass(), args.peek().getValue());
                        case SUB_GROUP:
                            validateAndConsolidate();
                            return;
                    }
                } else {
                    args.next();
                    optionSpecification.activateAndConsumeArguments(args);
                }
            } else {
                var looseArgsOptionSpecification = getLooseArgsOptionSpecification();
                if (looseArgsOptionSpecification != null) {
                    looseArgsOptionSpecification.activateAndConsumeArguments(args);
                } else {
                    switch (optionSetLevel) {
                        case MAIN_OPTIONS:
                            throw new InvalidCommandLineException("Invalid argument: " + args.peek());