So actually, we have a method in lang called toArray that does this for you