If I have a collection, such as Collection, how can I get the first item out? I could just call an Iterator, take its first
Guava provides an onlyElement Collector, but only use it if you expect the collection to have exactly one element.
Collection stringCollection = ...;
String string = collection.stream().collect(MoreCollectors.onlyElement())
If you are unsure of how many elements there are, use findFirst.
Optional optionalString = collection.stream().findFirst();