Guide to Guava ClassToInstanceMap 1. Overview A ClassToInstanceMap<B> is a special kind of map that associates classes with corresponding instances. It makes sure that all the keys and the values are subtypes of the upper bound type B. ClassToInstanceMap extends Java’s Map interface and provides two additional methods: T getInstance(Class<T>)… Continue Reading guava-class-to-instance-map

Guava – Join and Split Collections 1. Overview In this tutorial, we will learn how to use the Joiner and Splitter in the Guava library. We’ll convert collections into a String with the Joiner and we’ll split a String into a collection with the Splitter. 2. Convert List into String… Continue Reading guava-joiner-and-splitter-tutorial

Filtering and Transforming Collections in Guava 1. Overview In this tutorial, we’ll illustrate how to filter and transform collections with Guava. We will filter using Predicates, transform using the Functions that the library provides and finally, we’ll see how to combine both filtering and transforming. Further reading: New Stream, Comparator… Continue Reading guava-filter-and-transform-a-collection