public static void merge(List<PathDetail> pathDetails, List<PathDetail> otherDetails) {
        // Make sure that the PathDetail list is merged correctly at via points
        if (!pathDetails.isEmpty() && !otherDetails.isEmpty()) {
            PathDetail lastDetail = pathDetails.get(pathDetails.size() - 1);
            if (lastDetail.getValue().equals(otherDetails.get(0).getValue())) {
                lastDetail.setLast(otherDetails.get(0).getLast());
                otherDetails.remove(0);
            }
        }

        pathDetails.addAll(otherDetails);
    }
public static void merge ( List < PathDetail > pathDetails , List < PathDetail > otherDetails ) { if ( ! pathDetails . isEmpty ( ) && ! otherDetails . isEmpty ( ) ) { PathDetail lastDetail = pathDetails . get ( pathDetails . size ( ) - 1 ) ; if ( lastDetail . getValue ( ) . equals ( otherDetails . get ( 0 ) . getValue ( ) ) ) { lastDetail . setLast ( otherDetails . get ( 0 ) . getLast ( ) ) ; otherDetails . remove ( 0 ) ; } } pathDetails . addAll ( otherDetails ) ; }
Merges <code>otherDetails</code> into the <code>pathDetails</code>.
<p>
This method makes sure that Entry list around via points are merged correctly.
See #1091 and the misplaced PathDetail after waypoints.