InternalPath implements Path, AsValue { @Override public int length() { return relationships.size(); } 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 pathSizeShouldReturnNumberOfRelationships() { InternalPath path = testPath(); assertThat( path.length(), equalTo( 3 ) ); }
@Test void shouldBeAbleToCreatePathWithSingleNode() { InternalPath path = new InternalPath( new InternalNode( 1 ) ); assertThat( path.length(), equalTo( 0 ) ); }