@SuppressWarnings("unchecked")
    protected void moveToFrozenArrays(final long[] faid, final List<V> flv) {
        for (int i = 1; i < MAXLISTS; i++) {
            pa[i] = 0;
        }

        for (int ti = 0; ti < size; ti++) { // target-index
            int bp = size; // treat size as bitpattern
            int minIdx = -1;
            long minId = 0;
            int idx = 1;
            while (bp != 0) {
                if ((bp & 1) == 1) {
                    final int p = pa[idx];
                    if (p < al[idx].length) {
                        final long currentId = al[idx][p];
                        if (minIdx < 0 || currentId < minId) {
                            minIdx = idx;
                            minId = currentId;
                        }
                    }
                }
                idx++;
                bp >>= 1;
            }
            faid[ti] = minId;
            flv.add((V) vla[minIdx][pa[minIdx]]);
            pa[minIdx]++;

            if (ti > 0 && faid[ti - 1] == minId) {
                throw new IllegalArgumentException("duplicate key found in late check: " + minId);
            }
        }

        // free the non-frozen arrays
        al = null;
        vla = null;
    }
@return true if "id" is contained in this set.
main/src/main/java/cgeo/geocaching/brouter/util/CompactLongMap.java