InternalPath implements Path, AsValue { @Override public Iterable<Node> nodes() { return nodes; } InternalPath( List<Entity> alternatingNodeAndRel );  InternalPath( Entity... alternatingNodeAndRel );  InternalPath( List<Segment> segments, List<Node> nodes, List<Relationship> relationships ); @Override int length(); @Override boolean contains( Node node ); @Override boolean contains( Relationship relationship ); @Override Iterable<Node> nodes(); @Override Iterable<Relationship> relationships(); @Override Node start(); @Override Node end(); @Override Iterator<Segment> iterator(); @Override Value asValue(); @Override boolean equals( Object o ); @Override int hashCode(); @Override String toString();  }
@Test void shouldBeAbleToIterateOverPathNodes() { InternalPath path = testPath(); List<Node> segments = Iterables.asList( path.nodes() ); assertThat( segments, equalTo( Arrays.asList( (Node) new InternalNode( 1 ), new InternalNode( 2 ), new InternalNode( 3 ), new InternalNode( 4 ) ) ) ); }