Google Guava tips

How to get first element from iterable object ?

We can do that with...first() method. It allows to not only get the first element but also to get a default object when iterable object is empty: @Test public void should_get_first_element() { ...

Continue Reading →