Tag: Guava

Concatenate Multiple Lists in Java

In this article, several methods to concatenate multiple lists in Java into a single list are discussed using plain Java, Java 8, Guava Library and Apache Commons Collections.

Convert List of String to List of Integer in Java

In this post, we will see how to convert List of String to List of Integer in Java. If the value of specified string is negative (string prefixed with ASCII character ‘-‘ ), the sign should be preserved in the resultant integer.

Convert List to Set in Java

In this post, we will see how to convert list to set in Java. As Set collection contains no duplicate elements, any repeated elements in the list will be discarded.

Convert an Array to a Set in Java

In this post, we will see how to convert an array to a Set using plain Java, Guava and Apache Commons Collections. Please note that no duplicate elements are allowed in the array or duplicate will be discarded in set.