Create the path from the given close list.

@param startPoint is the starting point.
@param endPoint is the ending point.
@param closeList is the close list.
@return the path, or <code>null</code> if no path found.
501717
@Pure
	GP createPath(AStarNode<ST, PT> startPoint, PT endPoint, List<AStarNode<ST, PT>> closeList) {
		int idx;
		ST segment;
		PT point;
		AStarNode<ST, PT> node;
		GP path = null;
		final CloseComparator<ST, PT> cComparator = new CloseComparator<>();

		node = newAStarNode(endPoint, Double.NaN, Double.NaN, null);
		idx = ListUtil.indexOf(closeList, cComparator, node);

		if (idx >= 0) {
			node = closeList.remove(idx);
			point = node.getGraphPoint();
			segment = node.getArrivalConnection();
			if (point != null && segment != null) {
				final LinkedList<ST> pathSegments = new LinkedList<>();
				pathSegments.add(segment);
				do {
					point = segment.getOtherSidePoint(point);
					node = newAStarNode(point, Double.NaN, Double.NaN, null);
					idx = ListUtil.indexOf(closeList, cComparator, node);
					if (idx >= 0) {
						node = closeList.remove(idx);
						segment = node.getArrivalConnection();
						if (segment != null) {
							pathSegments.add(segment);
						}
					} else {
						point = null;
						segment = null;
					}
				}
				while (point != null && segment != null);

				// Building of the path is done is a second step
				// because the oriented graph cannot enable to
				// built it during the previous step loop:
				// isConnectedSegment replies false when tested
				// with an arrival segment and cannot
				// enable to go backward along the path.
				final Iterator<ST> iterator = pathSegments.descendingIterator();
				if (iterator.hasNext()) {
					segment = iterator.next();
					if (startPoint.getGraphPoint().isConnectedSegment(segment)) {
						path = newPath(startPoint.getGraphPoint(), segment);
						while (iterator.hasNext()) {
							addToPath(path, iterator.next());
						}
					}
				}
			}
		}

		return path;
	}
203506
private static <E> E getEndpoint(Class<E> type, String name, Reflections reflections) {
        E result = null;

        // Get concrete subclasses:
        Set<Class<? extends E>> foundClasses = reflections.getSubTypesOf(type);
        Set<Class<? extends E>> endpointClasses = new HashSet<>();
        for (Class<? extends E> clazz : foundClasses) {
            if (!Modifier.isAbstract(clazz.getModifiers())) {
                endpointClasses.add(clazz);
            }
        }

        // Filter out any default routes:
        //log.info("Filtering " + type.getName());
        Iterator<Class<? extends E>> iterator = endpointClasses.iterator();
        while (iterator.hasNext()) {
            Class<? extends E> next = iterator.next();
            if (StringUtils.startsWithIgnoreCase(next.getName(), "com.github.davidcarboni.restolino.routes.")) {
                //log.info("Filtered out " + next.getName());
                iterator.remove();
            } //else {
            //log.info("Filtered in " + next.getName());
            //}
        }
        //log.info("Filtered.");

        if (endpointClasses.size() != 0) {

            // Dump multiple endpoints:
            if (endpointClasses.size() > 1) {
                log.info("Warning: found multiple candidates for {} endpoint: {}", name, endpointClasses);
            }

            // Instantiate the endpoint if possible:
            try {
                result = endpointClasses.iterator().next().newInstance();
            } catch (Exception e) {
                log.info("Error: cannot instantiate {} endpoint class {}",name, endpointClasses.iterator().next());
                e.printStackTrace();
            }
        }

        return result;
    }
270708
public static List<Path> getAncestorPathList(Path startPath) {
		List<Path> ancestorPathList = new ArrayList<>();
		buildPathListOfAncestorDirectory(ancestorPathList, startPath);
		Collections.reverse(ancestorPathList);
		return ancestorPathList;
	}
991115
protected StringBuilder getPath(StringBuilder path, int startIndex, boolean addPoint) {
		boolean simple = true;
		if (key != null) {
			if (addPoint && path.length() > 0) {
				path.insert(0, '.');
			}
			if (key instanceof Integer) {
				path.insert(0, ']');
				if (startIndex == 0) {
					path.insert(0, key);
				} else {
					path.insert(0, startIndex + (int) key);
				}
				path.insert(0, '[');
				simple = false;
			} else {
				path.insert(0, key);
			}
		}
		if (parent != null) {
			parent.getPath(path, startIndex, simple);
		}
		return path;
	}
219565
protected static List<EndpointInfo> extractEndpointInfo(EndpointPart root) {
        List<EndpointInfo> endpoints = new ArrayList<EndpointInfo>();

        root.extractEndpointInfo(endpoints, "");

        return endpoints;
    }
26838
private Stream<Deque<Archive>> makePaths(Deque<Archive> path) {
        Set<Archive> nodes = endPoints.get(path.peekFirst());
        if (nodes == null || nodes.isEmpty()) {
            return Stream.of(new LinkedList<>(path));
        } else {
            return nodes.stream().map(n -> {
                Deque<Archive> newPath = new LinkedList<>();
                newPath.addFirst(n);
                newPath.addAll(path);
                return newPath;
            });
        }
    }
316832
public void setEndpoints(java.util.Collection<EndpointSummary> endpoints) {
        if (endpoints == null) {
            this.endpoints = null;
            return;
        }

        this.endpoints = new java.util.ArrayList<EndpointSummary>(endpoints);
    }
255867
public static KeyRange closedClosed(Key start, Key end) {
    return new KeyRange(checkNotNull(start), Endpoint.CLOSED, checkNotNull(end), Endpoint.CLOSED);
  }
146819
public static EndpointHelpDto fromResourceClass(Class<? extends AbstractResource> resourceClass) {
        Path path = resourceClass.getAnnotation(Path.class);
        Description description = resourceClass.getAnnotation(Description.class);

        if (path != null && description != null) {
            EndpointHelpDto result = new EndpointHelpDto();

            result.setDescription(description.value());
            result.setEndpoint(path.value());
            return result;
        } else {
            return null;
        }
    }
1251172
@SuppressWarnings("unchecked")
	@Override
	public T getEndpoint(String nodeID) {
		Endpoint[] array;
		if (nodeID == null && preferLocal) {
			array = getEndpointsByNodeID(this.nodeID);
			if (array.length == 0) {
				array = endpoints;
			}
		} else {
			array = getEndpointsByNodeID(nodeID);
		}
		if (array.length == 0) {
			return null;
		}
		if (array.length == 1) {
			return (T) array[0];
		}
		return (T) next(array);
	}
1210450
private Retrofit.Builder setEndpoint(Retrofit.Builder retrofitBuilder, String endpoint) {
    if (endpoint != null) {
      return retrofitBuilder.baseUrl(endpoint);
    }
    return retrofitBuilder;
  }
1133265
public List<Endpoint> awaitInitialEndpoints() throws InterruptedException {
        try {
            return initialEndpointsFuture.get();
        } catch (ExecutionException e) {
            throw new CompletionException(e.getCause());
        }
    }
893163
public JTSPointExpression<Point> endPoint() {
        if (endPoint == null) {
            endPoint = JTSGeometryExpressions.pointOperation(SpatialOps.END_POINT, mixin);
        }
        return endPoint;
    }
543808
public static String join(String endpoint, String path) {
        if (endpoint == null || endpoint.isEmpty())
            return path;
        if (path == null || path.isEmpty())
            return endpoint;

        if (StringUtils.endsWith(endpoint, "/") && path.startsWith("/")) {
            return endpoint + path.substring(1);
        } else if (StringUtils.endsWith(endpoint, "/") ^ path.startsWith("/")) {
            return endpoint + path;
        }
        return endpoint + "/" + path;
    }
371622
public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) {
        //	get the great circle path length in meters
        final int greatCircleLength = (int) startPoint.distanceToAsDouble(endPoint);

        //	add one point for every 100kms of the great circle path
        final int numberOfPoints = greatCircleLength/100000;

        addGreatCircle(startPoint, endPoint, numberOfPoints);
	}
1237060
public static V1BinaryAnnotation createAddress(String address, Endpoint endpoint) {
    if (endpoint == null) throw new NullPointerException("endpoint == null");
    return new V1BinaryAnnotation(address, null, endpoint);
  }
819320
public void calculateEndPoints(double start, double stop) {

		Point p1 = points.get(0);
		if (p1.getX().doubleValue() != start) {
			points.add(0, new Point(start, p1.getY()));
		}

		int end = points.size();
		Point p2 = points.get(end - 1);
		if (p2.getY().doubleValue() != stop) {
			points.add(end, new Point(stop, p2.getY()));
		}
	}