* @return Vector
   */
  public static Vector coerceToVector(Stella_Object self) {
    { Vector vector = null;

      { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

        if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_VECTOR)) {
          { Vector self000 = ((Vector)(self));

            vector = self000;
            { Stella_Object m = null;
              Vector vector000 = self000;
              int index000 = 0;
              int length000 = vector000.length();
              int i = Stella.NULL_INTEGER;
              int iter000 = 0;

              for (;index000 < length000; index000 = index000 + 1, iter000 = iter000 + 1) {
                m = (vector000.theArray)[index000];
                i = iter000;
                (vector.theArray)[i] = (Logic.coerceToInstanceOrLiteral(m, null));
              }
            }
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_LIST)) {
          { List self000 = ((List)(self));

            vector = Vector.newVector(self000.length());
            { Stella_Object m = null;
              Cons iter001 = self000.theConsList;
              int i = Stella.NULL_INTEGER;
              int iter002 = 0;

              for (;!(iter001 == Stella.NIL); iter001 = iter001.rest, iter002 = iter002 + 1) {
                m = iter001.value;
                i = iter002;
                (vector.theArray)[i] = (Logic.coerceToInstanceOrLiteral(m, null));
              }
            }
          }
        }
        else if (testValue000 == Logic.SGT_STELLA_CONS) {
          { Cons self000 = ((Cons)(self));

            vector = Vector.newVector(self000.length());
            { Stella_Object m = null;
              Cons iter003 = self000;
              int i = Stella.NULL_INTEGER;
              int iter004 = 0;

              for (;!(iter003 == Stella.NIL); iter003 = iter003.rest, iter004 = iter004 + 1) {
                m = iter003.value;
                i = iter004;
                (vector.theArray)[i] = (Logic.coerceToInstanceOrLiteral(m, null));
              }
            }
          }
        }
        else {
          {
            System.out.println("Don't know how to coerce `" + self + "' of type `" + self.primaryType() + "'");
            System.out.println("   into a vector.");
          }
;
        }
      }
      return (vector);
    }
  }