@SuppressWarnings("rawtypes") public PathRepresentation findSinglePath(long startId, long endId, Map<String, Object> map) { FindParams findParams = new FindParams(startId, endId, map).invoke(); PathFinder finder = findParams.getFinder(); Node startNode = findParams.getStartNode(); Node endNode = findParams.getEndNode(); Path path = finder.findSinglePath(startNode, endNode); if (path == null) { throw new NotFoundException(); } return findParams.pathRepresentationOf(path); }