Test typecasting on instance rather than class itself