class 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);
                    }
                } );
    }

    public  PathRepresentation( P path );

}