the guava Iterables.toArray method might be the better fit here.