Cons an Iterable [closed]
I cannot find a method cons. Such a method would add a single item to an Iterable. Instead, do I have to use
Iterables.concat(list, Collections.singletonList(item))
? The following would be quite nice.
Iterables.cons(list, item)
So, write a method cons(Iterable<T>, T)
that makes the slightly-more complicated call to concat
.
精彩评论