The Collectors class in Java 8 provides methods for grouping and partitioning data stored in collections. Grouping permits you to organize data that shares a common field value, e.g. department. Partitioning allows you to divide the data into two categories, or partitions. One partition satisfies the partitioning criteria whereas the other partition does not. For example, we might separate sales data into a partition that met or exceeded a sales goal and a partition that did not. Our case study below will apply grouping and partitioning technology to a collection of musical instruments.

Leave a Reply

Your email address will not be published. Required fields are marked *