PathUtils { public static LineLinkedListElement findElementInQueue( final Queue<? extends LineLinkedListElement> pq, final Line line) { if (pq == null || line == null) { throw new IllegalArgumentException(); } Iterator<? extends LineLinkedListElement> iter = pq.iterator(); long id = line.getID(); while (iter.hasNext()) { LineLinkedListElement next = iter.next(); if (next.getLine().getID() == id) { return next; } } return null; } 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 testFindElementInQueue() { assertEquals(PathUtils.findElementInQueue(pq, l1), elem1); assertEquals(PathUtils.findElementInQueue(pq, l4), elem4); assertEquals(PathUtils.findElementInQueue(new PriorityQueue<PQElem>(), l4), null); }
@Test(expectedExceptions = IllegalArgumentException.class) public final void testFindElementInQueueException01() { PathUtils.findElementInQueue(pq, null); }
@Test(expectedExceptions = IllegalArgumentException.class) public final void testFindElementInQueueException02() { PathUtils.findElementInQueue(null, l1); }