private void addDependency(Method m, Set<Dependency> dependencies, Class<?> type, State state) {
        try {
            dependencies.add(
                new DependencyImpl(
                    getOrCreate(type),
                    state
                )
            );
        } catch (final CyclicReferenceException ex) {
            throw new CyclicReferenceException(m.getDeclaringClass(), ex);
        } catch (final IllegalArgumentException iae) {
            throw new IllegalStateException("Unable to resolve " + m.toString() + " (" + type.toString() + ") at state " + state.toString(), iae);
        }
    }
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