private Execution<?> createExecution(Method m, State executeBefore) {
        final Set<Dependency> dependencies = new HashSet<>();
        try {
            for (int i = 0; i < m.getParameterCount(); i++) {
                final Parameter p   = m.getParameters()[i];
                final WithState ws  = p.getAnnotation(WithState.class);

                // TODO: Maybe create a dependency even if WithState is missing,

                if (ws != null) {
                    addDependency(m, dependencies, p.getType(), ws.value());
                }
            }
        } catch (final CyclicReferenceException ex) {
            throw new IllegalStateException("Could not execute method " + methodName(m) + " since one of its dependencies had not been injected.", ex);
        }

        return new ReflectionExecutionImpl<>(
            m.getDeclaringClass(),
            executeBefore,
            dependencies,
            m,
            proxyFunction.apply(m.getDeclaringClass())
        );
    }
The default implementation of the {@link DependencyGraph} interface.

@author Emil Forslund
@since  1.0.0
common-parent/injector/src/main/java/com/speedment/common/injector/internal/dependency/DependencyGraphImpl.java