public void edge(T from, T to) {
        if (from == null || to == null)
            throw new IllegalArgumentException("Null vertices are not allowed, edge: " + from + "->" + to);

        adjMap.computeIfAbsent(from, k -> new LinkedHashSet<>()).add(to);
        adjMap.computeIfAbsent(to, k -> new LinkedHashSet<>());
    }
Class representing a directed graph.

@author gjoranv
container-core/src/main/java/com/yahoo/container/di/componentgraph/cycle/Graph.java