@Test public void testAdd() { DAG<Integer> dag = DAG.of(1); assertEquals(dag.size(), 1); }
@SafeVarargs public final DAG<T> add(T elem, T... parents) { add(elem, Arrays.asList(parents)); return this; }
DAG { @SafeVarargs public final DAG<T> add(T elem, T... parents) { add(elem, Arrays.asList(parents)); return this; } }
DAG { @SafeVarargs public final DAG<T> add(T elem, T... parents) { add(elem, Arrays.asList(parents)); return this; } private  DAG(); }
DAG { @SafeVarargs public final DAG<T> add(T elem, T... parents) { add(elem, Arrays.asList(parents)); return this; } private  DAG(); static DAG<T> empty(); @SuppressWarnings("unchecked") static DAG<T> of(T ...rootElements); static DAG<T> of(Iterable<T> rootElements); @SafeVarargs final DAG<T> add(T elem, T... parents); DAG<T> add(T elem, List<T> parents); Node<T> getNode(T elem); Collection<Node<T>> getRoots(); Collection<Node<T>> getLeafs(); DAG<T> parentSubGraph(T elem); int size(); Stream<T> nodes(); Stream<Node<T>> traverse(); @Override String toString(); }
DAG { @SafeVarargs public final DAG<T> add(T elem, T... parents) { add(elem, Arrays.asList(parents)); return this; } private  DAG(); static DAG<T> empty(); @SuppressWarnings("unchecked") static DAG<T> of(T ...rootElements); static DAG<T> of(Iterable<T> rootElements); @SafeVarargs final DAG<T> add(T elem, T... parents); DAG<T> add(T elem, List<T> parents); Node<T> getNode(T elem); Collection<Node<T>> getRoots(); Collection<Node<T>> getLeafs(); DAG<T> parentSubGraph(T elem); int size(); Stream<T> nodes(); Stream<Node<T>> traverse(); @Override String toString();  }