int current = 0; int[][] members = new int[vecMembers.size()][];
Arrays.sort(values, 0, size, new Comparator() { public int compare(Object o1, Object o2) { int[] v1 = (int[]) o1; int[] v2 = (int[]) o2; if (v1[0] == v2[0]) return v1[1] - v2[1]; return v1[0] - v2[0]; } });
  private static int[][] normalize(Vector vecMembers)  {    // XXX: Perhaps we should merge ranges that overlap.        int current = 0;    int[][] members = new int[vecMembers.size()][];    while (vecMembers.size() > 0)      {        // Search the lowest range.        int[] range = (int[]) vecMembers.elementAt(0);        for (int index = 1; index < vecMembers.size(); index++)          {            int[] tmp = (int[]) vecMembers.elementAt(index);            if (range[0] > tmp[0]                || (range[0] == tmp[0]                    && range[0] > tmp[0]))              range = tmp;          }        members[current] = range;        current++;      }        return members;  }