Hamcrest Collections Cookbook
1. Introduction This cookbook illustrates how to make use of Hamcrest matchers to work with and test collections. The format of the cookbook is example focused and practical […]
1. Introduction This cookbook illustrates how to make use of Hamcrest matchers to work with and test collections. The format of the cookbook is example focused and practical […]
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 […]
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 […]
1. Introduction This cookbook article is organized into small and focused recipes and code snippets for using Guava style collections. The format is that of a growing list […]
1. Introduction MapUtils is one of the tools available in the Apache Commons Collections project. Simply put, it provides utility methods and decorators to work with java.util.Map and java.util.SortedMap instances. […]
1. Overview Simply put, the Apache CollectionUtils provides utility methods for common operations which cover a wide range of use cases and helps in avoiding writing boilerplate code. […]
1. Overview In this short article, we’ll be looking at an interesting data structure in the Apache Commons Collections library – the BidiMap. The BidiMap adds a possibility […]
1. Overview The Apache Commons Collections library provides useful classes that complement the Java Collections Framework. In this article, we will review the interface OrderedMap, which extends java.util.Map. 2. […]
1. Overview In this article, we’ll be exploring the SetUtils API of Apache Commons Collections library. Simply put, these utilities can be used to execute certain operations […]
1. Introduction In this quick article, we’ll focus on how to use the Apache’s Bag collection. 2. Maven Dependency Before we start, we need to import the […]
1. Overview In this quick tutorial, we’re going to talk about four different ways to remove items from Java Collections that match certain predicates. We’ll naturally also look […]
1. Introduction Java Collections is a topic often brought up on technical interviews for Java developers. This article reviews some important questions that are asked […]
1. Overview Java 9 brings the long-awaited syntactic sugar for creating small unmodifiable Collection instances using a concise code one-liner. As per JEP 269, new convenience factory methods […]
1. Overview In this quick tutorial, we’ll learn how to join and to split Arrays and Collections in Java, making good use of the new stream support. 2. Join […]
1. Introduction In this tutorial, we’ll illustrate how to zip two collections into one logical collection. The “zip” operation is slightly different from the standard “concat” […]
1. Overview In this quick article, we’ll explore how to flatten a nested collection in Java. 2. Example of a Nested Collection Suppose we have […]
1. Overview In this quick article, we’ll see how we can shuffle a collection in Java. Java has a built-in method for shuffling List objects — we’ll utilize […]
1. Introduction In this tutorial, we’re going to show how to inject Java collections using the Spring framework. Simply put, we’ll demonstrate examples with the List, Map, Set collection interfaces. 2. List With @Autowired […]