### Question:
PathRepresentation extends ObjectRepresentation { @Mapping( "directions" ) public ListRepresentation directions() { ArrayList<String> directionStrings = new ArrayList<>(); Iterator<Node> nodeIterator = path.nodes().iterator(); Iterator<Relationship> relationshipIterator = path.relationships().iterator(); Relationship rel; Node startNode; Node endNode = nodeIterator.next(); while ( relationshipIterator.hasNext() ) { rel = relationshipIterator.next(); startNode = endNode; endNode = nodeIterator.next(); if ( rel.getStartNode().equals(startNode) && rel.getEndNode().equals(endNode) ) { directionStrings.add( "->" ); } else { directionStrings.add( "<-" ); } } return new ListRepresentation( RepresentationType.STRING, new IterableWrapper<Representation, String>( directionStrings ) { @Override protected Representation underlyingObjectToObject( String directionString ) { return ValueRepresentation.string(directionString); } } ); } PathRepresentation( P path ); @Mapping( "start" ) ValueRepresentation startNode(); @Mapping( "end" ) ValueRepresentation endNode(); @Mapping( "length" ) ValueRepresentation length(); @Mapping( "nodes" ) ListRepresentation nodes(); @Mapping( "relationships" ) ListRepresentation relationships(); @Mapping( "directions" ) ListRepresentation directions();  }### Answer:
@Test public void shouldHaveDirectionList() { assertNotNull( pathrep().directions() ); }