use of Iterables.toArray to convert the iterable to an array