@Override
    public @NonNull Collection<@NonNull CommandDescriptor> extractCommands(final @NonNull Object instance) {
        final AnnotationAccessor classAnnotations = AnnotationAccessor.of(instance.getClass());
        final Command classCommand = classAnnotations.annotation(Command.class);

        final String syntaxPrefix;
        if (classCommand == null) {
            syntaxPrefix = "";
        } else {
            syntaxPrefix = this.annotationParser.processString(classCommand.value()) + " ";
        }

        final Method[] methods = instance.getClass().getDeclaredMethods();
        final Collection<CommandDescriptor> commandDescriptors = new ArrayList<>();
        for (final Method method : methods) {
            final Command[] commands = method.getAnnotationsByType(Command.class);
            if (commands.length == 0) {
                continue;
            }

            if (!method.isAccessible()) {
                method.setAccessible(true);
            }
            if (Modifier.isStatic(method.getModifiers())) {
                throw new IllegalArgumentException(String.format(
                        "@Command annotated method '%s' is static! @Command annotated methods should not be static.",
                        method.getName()
                ));
            }

            for (final Command command : commands) {
                final String syntax = syntaxPrefix + this.annotationParser.processString(command.value());
                commandDescriptors.add(
                        ImmutableCommandDescriptor.builder()
                                .method(method)
                                .syntax(this.annotationParser.syntaxParser().parseSyntax(method, syntax))
                                .commandToken(syntax.split(" ")[0].split("\\|")[0])
                                .requiredSender(command.requiredSender())
                                .build()
                );
            }
        }
        return commandDescriptors;
    }
Creates a new command extractor.

@param annotationParser annotation parser
cloud-annotations/src/main/java/org/incendo/cloud/annotations/extractor/CommandExtractorImpl.java