How to create FluentIterable from one element?

This is the API from guava FluentIterable.of(E[] e)

Hope this is how FluentIterable.of(E... e), so I can create it from one element.

Am I missing something or is there some special reason to avoid this?

Now my code

FluentIterable.from(Lists.newArrayList(singleElement));//UGLY

Thanks.

+4
source share

Source: https://habr.com/ru/post/1625852/


All Articles