* @param type
   * @return Stella_Object
   */
  public static Stella_Object cast(Stella_Object value, Surrogate type) {
    if ((((Integer)(Stella.$SAFETY$.get())).intValue() >= 2) &&
        ((Stella.$STARTUP_TIME_PHASE$ == 999) &&
         Stella.$UNFINALIZED_CLASSES$.emptyP())) {
      if ((value != null) &&
          (!Stella_Object.isaP(value, type))) {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          {
            stream000.nativeStream.println("Run-time casting violation.  The value: ");
            stream000.nativeStream.println("`" + value + "'");
            stream000.nativeStream.print(" is not of type `" + type + "'.");
          }
;
          throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
    }
    return (value);
  }