private void assertAnnotationsCorrect(Object instance) {
        traverseMethods(instance.getClass())
            .filter(m -> m.isAnnotationPresent(ExecuteBefore.class))
            .forEach(m -> {
                final ExecuteBefore execute = m.getAnnotation(ExecuteBefore.class);
                final List<Parameter> errenousParams = Stream.of(m.getParameters())
                    .filter(p -> p.isAnnotationPresent(WithState.class))
                    .filter(p -> {
                        final State paramState = p.getAnnotation(WithState.class).value();
                        return !(paramState == execute.value()
                        || (paramState.isBefore(State.STARTED) && paramState.next() == execute.value()));
                    })
                    .collect(toList());

                if (!errenousParams.isEmpty()) {
                    throw new MisusedAnnotationException(format(
                        "The class %s has an auto-executed method %s(%s) " +
                        "that should execute just before the instance " +
                        "enters the %s state, so the parameters must %s " +
                        "when the method is invoked. Yet, the " +
                        "@WithState-annotation is present on %d " +
                        "parameter%s with requested state%s %s.",
                        instance.getClass().getSimpleName(),
                        m.getName(),
                        Stream.of(m.getParameters())
                            .map(Parameter::getType)
                            .map(Class::getSimpleName)
                            .collect(joining(", ")),
                        execute.value().name(),
                        execute.value() == State.CREATED
                            ? "also be in the CREATED state"
                            : String.format(
                                "either be in the %s or the %s state",
                                execute.value().previous().name(),
                                execute.value().name()
                            ),
                        errenousParams.size(),
                        errenousParams.size() > 1 ? "s" : "",
                        errenousParams.size() > 1 ? "s" : "",
                        commaAnd(errenousParams.stream()
                            .map(p -> p.getAnnotation(WithState.class))
                            .map(WithState::value)
                            .map(State::name)
                            .toArray(String[]::new))
                    ));
                }
            });
    }
Default implementation of the {@link InjectorBuilder}-interface.

@author Emil Forslund
@since  1.2.0
common-parent/injector/src/main/java/com/speedment/common/injector/internal/InjectorBuilderImpl.java