* @param predicate
   * @return Cons
   */
  public Cons sortTuples(int n, java.lang.reflect.Method predicate) {
    { Cons self = this;

      if ((predicate == null) &&
          (!(self == Stella.NIL))) {
        predicate = Stella_Object.chooseSortPredicate(((Cons)(self.value)).nth(n));
      }
      { Object old$SortTupleComparePredicate$000 = Stella.$SORT_TUPLE_COMPARE_PREDICATE$.get();
        Object old$SortTupleCompareIndex$000 = Stella.$SORT_TUPLE_COMPARE_INDEX$.get();

        try {
          Native.setSpecial(Stella.$SORT_TUPLE_COMPARE_PREDICATE$, predicate);
          Native.setIntSpecial(Stella.$SORT_TUPLE_COMPARE_INDEX$, n);
          return (Cons.helpSortConsList(self, self.length(), Native.find_java_method("edu.isi.stella.Cons", "sortTupleCompareP", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.Cons"), Native.find_java_class("edu.isi.stella.Cons")})));

        } finally {
          Stella.$SORT_TUPLE_COMPARE_INDEX$.set(old$SortTupleCompareIndex$000);
          Stella.$SORT_TUPLE_COMPARE_PREDICATE$.set(old$SortTupleComparePredicate$000);
        }
      }
    }
  }