public static Cons attachUnhandledCaseErrorClause(Cons casetree, Stella_Object testtree) {
    { Stella_Object lastclause = casetree.last();

      if (Stella_Object.consP(lastclause) &&
          (!(((Cons)(lastclause)).value == Stella.SYM_STELLA_OTHERWISE))) {
        return (casetree.concatenate(Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_OTHERWISE, Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_ERROR, Cons.cons(Stella_Object.copyConsTree(testtree), Cons.cons(Cons.cons(StringWrapper.wrapString(" is not a valid case option"), Stella.NIL), Stella.NIL)))), Cons.cons(Stella.NIL, Stella.NIL)))), Stella.NIL), Stella.NIL));
      }
      else {
        return (casetree);
      }
    }
  }