// Path: src/main/java/com/github/jankroken/commandline/util/Methods.java
// public class Methods {
// 
// 	private final Class<?> annotatedClass;
// 
// 	public Methods(Class<?> annotatedClass) {
//         this.annotatedClass = annotatedClass;
//     }
// 
// 	public List<Method> byAnnotation(Class<? extends Annotation> searchAnnotation) {
// 		List<Method> methods = new ArrayList<>();
// 		methodLoop:
// 		for (final var method : annotatedClass.getMethods()) {
// 			if (method.isAnnotationPresent(searchAnnotation)) {
// 				methods.add(method);
// 				continue methodLoop;
// 			}
// 		}
// 		return methods;
// 	}
// }


import com.github.jankroken.commandline.annotations.*;
import com.github.jankroken.commandline.util.Methods;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
            } else if (annotation instanceof LongSwitch) {
                builder.addLongSwitch(((LongSwitch) annotation).value());
            } else if (annotation instanceof ShortSwitch) {
                builder.addShortSwitch(((ShortSwitch) annotation).value());
            } else if (annotation instanceof Toggle) {
                builder.addToggle(((Toggle) annotation).value());
            } else if (annotation instanceof SingleArgument) {
                builder.addSingleArgument();
            } else if (annotation instanceof AllAvailableArguments) {
                builder.addAllAvailableArguments();
            } else if (annotation instanceof ArgumentsUntilDelimiter) {
                builder.addUntilDelimiter(((ArgumentsUntilDelimiter) annotation).value());
            } else if (annotation instanceof SubConfiguration) {
                builder.addSubset(((SubConfiguration) annotation).value());
            } else if (annotation instanceof Required) {
                builder.addRequired();
            } else if (annotation instanceof Multiple) {
                builder.addOccurrences(Occurrences.MULTIPLE);
            } else if (annotation instanceof LooseArguments) {
                builder.addLooseArgs();
            } else {
                // todo
                System.out.println("Unhandled annotation: " + annotation);
            }
        }
        return builder.getOptionSpecification();

    }

    public static List<OptionSpecification> getOptionSpecifications(Object spec, Class<?> optionClass) {
// Path: src/main/java/com/github/jankroken/commandline/util/Methods.java
// public class Methods {
// 
// 	private final Class<?> annotatedClass;
// 
// 	public Methods(Class<?> annotatedClass) {
//         this.annotatedClass = annotatedClass;
//     }
// 
// 	public List<Method> byAnnotation(Class<? extends Annotation> searchAnnotation) {
// 		List<Method> methods = new ArrayList<>();
// 		methodLoop:
// 		for (final var method : annotatedClass.getMethods()) {
// 			if (method.isAnnotationPresent(searchAnnotation)) {
// 				methods.add(method);
// 				continue methodLoop;
// 			}
// 		}
// 		return methods;
// 	}
// }


// Path: src/main/java/com/github/jankroken/commandline/domain/internal/OptionSpecificationFactory.java
import com.github.jankroken.commandline.annotations.*;
import com.github.jankroken.commandline.util.Methods;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

            } else if (annotation instanceof LongSwitch) {
                builder.addLongSwitch(((LongSwitch) annotation).value());
            } else if (annotation instanceof ShortSwitch) {
                builder.addShortSwitch(((ShortSwitch) annotation).value());
            } else if (annotation instanceof Toggle) {
                builder.addToggle(((Toggle) annotation).value());
            } else if (annotation instanceof SingleArgument) {
                builder.addSingleArgument();
            } else if (annotation instanceof AllAvailableArguments) {
                builder.addAllAvailableArguments();
            } else if (annotation instanceof ArgumentsUntilDelimiter) {
                builder.addUntilDelimiter(((ArgumentsUntilDelimiter) annotation).value());
            } else if (annotation instanceof SubConfiguration) {
                builder.addSubset(((SubConfiguration) annotation).value());
            } else if (annotation instanceof Required) {
                builder.addRequired();
            } else if (annotation instanceof Multiple) {
                builder.addOccurrences(Occurrences.MULTIPLE);
            } else if (annotation instanceof LooseArguments) {
                builder.addLooseArgs();
            } else {
                // todo
                System.out.println("Unhandled annotation: " + annotation);
            }
        }
        return builder.getOptionSpecification();

    }

    public static List<OptionSpecification> getOptionSpecifications(Object spec, Class<?> optionClass) {
        var methods = new Methods(optionClass).byAnnotation(Option.class);