code: public static StackManipulation to(TypeDefinition typeDefinition) {
          if (typeDefinition.isPrimitive()) {
              throw new IllegalArgumentException("Cannot cast to primitive type: " + typeDefinition);
          }
          return new TypeCasting(typeDefinition.asErasure());
      }
docs: Creates a casting to the given, non-primitive type.
  
  @param typeDefinition The type to which a value should be casted.
  @return A stack manipulation that represents the casting.