public static Cons javaTranslateCaseTree(Cons tree) {
    { Cons otherwisecondition = null;
      Cons conditions = Stella.NIL;
      Stella_Object keyform = null;
      boolean symbolcasep = false;

      symbolcasep = Stella_Object.javaSymbolCaseP(tree.rest.value);
      keyform = Stella_Object.javaTranslateATree(tree.rest.value);
      { Stella_Object condition = null;
        Cons iter000 = tree.rest.rest;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          condition = iter000.value;
          if (Stella_Object.safePrimaryType(condition) == Stella.SGT_STELLA_CONS) {
            { Cons condition000 = ((Cons)(condition));

              if (condition000.value == Stella.SYM_STELLA_OTHERWISE) {
                otherwisecondition = Cons.cons(Stella.SYM_STELLA_JAVA_STATEMENTS, Cons.javaTranslateListOfTrees(condition000.rest).concatenate(Stella.NIL, Stella.NIL));
              }
              else {
                conditions = Cons.cons(Cons.javaTranslateCondition(condition000, symbolcasep), conditions);
              }
            }
          }
          else {
            { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print("`" + Stella_Object.safePrimaryType(condition) + "' is not a valid case option");
              throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
            }
          }
        }
      }
      tree.rest.rest = Stella.NIL;
      return (Cons.list$(Cons.cons(Stella.SYM_STELLA_JAVA_CASE, Cons.cons(keyform, Cons.cons(Cons.cons(otherwisecondition, Cons.cons(conditions.reverse(), Stella.NIL)), Stella.NIL)))));
    }
  }