Testing toObjecct