}
@Override
public List<?> getBaconPath( final Actor actor )
{
final Node baconNode;
if ( actor == null )
{
throw new IllegalArgumentException( "Null actor" );
}
try
{
baconNode = graphDbService.getReferenceNode().getSingleRelationship(
RelTypes.IMDB, Direction.OUTGOING ).getEndNode();
}
catch ( NoSuchElementException e )
{
throw new NoSuchElementException(
"Unable to find Kevin Bacon actor" );
}
final Node actorNode = ((ActorImpl) actor).getUnderlyingNode();
final List<Node> list = pathFinder.shortestPath( actorNode, baconNode,
RelTypes.ACTS_IN );
return convertNodesToActorsAndMovies( list );
}