PathUtils { public static boolean checkPathConnection(final List<Line> path) { if (path == null) { return true; } int size = path.size(); for (int i = 0; i < size - 1; ++i) { Line currentline = path.get(i); Line successorline = path.get(i + 1); Iterator<? extends Line> iter = currentline.getNextLines(); boolean found = false; while (iter.hasNext()) { if (successorline.getID() == iter.next().getID()) { found = true; break; } } if (!found) { return false; } } return true; } private  PathUtils(); static int getLength(final List<Line> path, final Line start,
                                final Line end); static int getLength(final List<Line> path); static boolean checkPathConnection(final List<Line> path); static List<Line> constructPath(final LineLinkedListElement dest); static LineLinkedListElement findElementInQueue(
            final Queue<? extends LineLinkedListElement> pq, final Line line); static Line findCommonLineInPaths(final List<? extends Line> location,
                                             final LineLinkedListElement el);  }
@Test public final void testCheckPathConnection() { assertTrue(PathUtils.checkPathConnection(path)); assertFalse(PathUtils.checkPathConnection(notConnectedPath)); assertTrue(PathUtils.checkPathConnection(null)); assertTrue(PathUtils.checkPathConnection(emptyPath)); }