code: private void rankArrayList(List<InvPair> v) {
          int num = 1;
          int[] temp = new int[v.size()];
          InvPair last = (InvPair) v.get(0);
          Iterator<InvPair> it = v.iterator();
          InvPair curr;
          for (int x = 0; it.hasNext(); x++) {
              curr = (InvPair) it.next();
              if (!last.equals(curr)) {
                  num++;
              }
              temp[x] = num;
              last = curr;
          }
          it = v.iterator();
          for (int x = 0; it.hasNext(); x++) {
              curr = (InvPair) it.next();
              curr.setCurr(temp[x]);
              curr.setPrime();
          }
      }
docs: Rank atomic vector, corresponds to step 4.
  
  @param v the invariance pair vector