resultList.add(paths[paths.length-1]);
resultList.addLast(paths[paths.length-1]); resultList = removeDuplicateEntries(resultList);
    protected String[] filterPaths(String[] paths) {        List resultList = new LinkedList();        if(paths.length == 0) {            return new String[0];        }        if(paths.length == 1) {            return new String[] {paths[0]};        }                String oldPath = paths[0];        String oldIdentifier = extractIdentifier(oldPath);                for (int i = 1; i < paths.length; i++) {            String path = paths[i];            String identifier = extractIdentifier(path);                        if( ! identifier.equals(oldIdentifier)) {                resultList.add(oldPath);                oldIdentifier = identifier;            }            oldPath = path;        }        // The last of the platforms is always the highest. But the loop above does not catch this.        resultList.add(paths[paths.length-1]);        return (String[]) resultList.toArray(new String[resultList.size()]);    }