public static Cons mergeConsLists(Cons list1, Cons list2, java.lang.reflect.Method predicate) {
    { Cons cursor1 = list1;
      Cons cursor2 = list2;
      Cons result = Stella.NIL;
      Cons tail = Stella.NIL;
      Cons temp = Stella.NIL;

      for (;;) {
        if (cursor1 == Stella.NIL) {
          if (tail == Stella.NIL) {
            return (cursor2);
          }
          tail.rest = cursor2;
          return (result);
        }
        if (cursor2 == Stella.NIL) {
          if (tail == Stella.NIL) {
            return (cursor1);
          }
          tail.rest = cursor1;
          return (result);
        }
        if (((Boolean)(edu.isi.stella.javalib.Native.funcall(predicate, null, new java.lang.Object [] {cursor2.value, cursor1.value}))).booleanValue()) {
          temp = cursor2;
          cursor2 = cursor2.rest;
          list2 = cursor2;
        }
        else {
          temp = cursor1;
          cursor1 = cursor1.rest;
          list1 = cursor1;
        }
        if (tail == Stella.NIL) {
          result = temp;
        }
        else {
          tail.rest = temp;
        }
        tail = temp;
      }
    }
  }