code: private boolean isInvPart(List<InvPair> v) {
          if (((InvPair) v.get(v.size() - 1)).getCurr() == v.size()) return true;
          Iterator<InvPair> it = v.iterator();
          InvPair curr;
          while (it.hasNext()) {
              curr = (InvPair) it.next();
              if (curr.getCurr() != curr.getLast()) return false;
          }
          return true;
      }
docs: Checks to see if the vector is invariantly partitioned
  
  @param v the invariance pair vector
  @return true if the vector is invariantly partitioned, false otherwise