@Test public void toImmutable() { MutablePath<TestVertex, TestEdge> p = new DefaultMutablePath<>(); p.appendEdge(new TestEdge(A, B, 1)); p.appendEdge(new TestEdge(B, C, 1)); validatePath(p, A, C, 2); assertEquals("immutables should equal", p.toImmutable(), p.toImmutable()); validatePath(p.toImmutable(), A, C, 2); }
@Override public Path<V, E> toImmutable() { return new DefaultPath<>(edges, cost); }
DefaultMutablePath implements MutablePath<V, E> { @Override public Path<V, E> toImmutable() { return new DefaultPath<>(edges, cost); } }
DefaultMutablePath implements MutablePath<V, E> { @Override public Path<V, E> toImmutable() { return new DefaultPath<>(edges, cost); } DefaultMutablePath();  DefaultMutablePath(Path<V, E> path); }
DefaultMutablePath implements MutablePath<V, E> { @Override public Path<V, E> toImmutable() { return new DefaultPath<>(edges, cost); } DefaultMutablePath();  DefaultMutablePath(Path<V, E> path); @Override V src(); @Override V dst(); @Override double cost(); @Override List<E> edges(); @Override void setCost(double cost); @Override Path<V, E> toImmutable(); @Override void insertEdge(E edge); @Override void appendEdge(E edge); @Override void removeEdge(E edge); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
DefaultMutablePath implements MutablePath<V, E> { @Override public Path<V, E> toImmutable() { return new DefaultPath<>(edges, cost); } DefaultMutablePath();  DefaultMutablePath(Path<V, E> path); @Override V src(); @Override V dst(); @Override double cost(); @Override List<E> edges(); @Override void setCost(double cost); @Override Path<V, E> toImmutable(); @Override void insertEdge(E edge); @Override void appendEdge(E edge); @Override void removeEdge(E edge); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }