class PathUtils {

    public static int getLength(final List<Line> path, final Line start,
                                final Line end) {
        if (path == null || path.isEmpty()) {
            return 0;
        }
        int posStart = path.indexOf(start);
        int posEnd = path.indexOf(end);
        if (posStart < 0 || posEnd < 0 || posEnd < posStart) {
            return -1;
        }
        int length = 0;
        int i = posStart;
        while (i <= posEnd) {
            length += path.get(i).getLineLength();
            i++;
        }
        return length;
    }

    private  PathUtils();

}