The Baeldung logo
  • The Baeldung Logo
  • Start Here
  • Courses ▼▲
    • REST with Spring

      The canonical reference for building a production grade API with Spring

    • Learn Spring Security ▼▲

      THE unique Spring Security education if you’re working with Java today

      • Learn Spring Security Core

        Focus on the Core of Spring Security 5

      • Learn Spring Security OAuth

        Focus on the new OAuth2 stack in Spring Security 5

    • Learn Spring

      From no experience to actually building stuff​

    • Learn Spring Data JPA

      The full guide to persistence with Spring Data JPA

  • Guides ▼▲
    • Persistence

      The Persistence with Spring guides

    • REST

      The guides on building REST APIs with Spring

    • Security

      The Spring Security guides

  • About ▼▲
    • Full Archive

      The high level overview of all the articles on the site.

    • Baeldung Ebooks

      Discover all of our eBooks

    • About Baeldung

      About Baeldung.

Category upJava

Java Collections

Learn about the Java Collections framework that provides interfaces and implementations for Lists, Maps, and Sets. Learn how to work with Java Collections through the guides below.

  • Java List (62)
  • Java Map (62)
  • Java Set (26)
  • Java Streams (25)
  • Java Array (19)
  • Core Java (10)
  • Java Queue (9)
  • Java String (6)

>> Difference Between parallelStream() and stream().parallel() in Java

>> Can Stream.collect() Return the null Value?

>> Moving Items Around in an Arraylist

>> Handle Duplicate Keys When Producing Map Using Java Stream

>> Copying All Keys and Values From One Hashmap Onto Another Without Replacing Existing Keys and Values

>> Finding All Duplicates in a List in Java

>> Combining Two Lists Into a Map in Java

>> Spring Data Repositories – Collections vs. Stream

>> Check if Object Is an Array in Java

>> Initialize an ArrayList with Zeroes or Null in Java

>> Stream to Iterable in Java

>> Java List Interface

>> Convert an ArrayList of Object to an ArrayList of String Elements

>> Batch Processing of Stream Data in Java

>> Storing Data Triple in a List in Java

>> Case-Insensitive Searching in ArrayList

>> Converting a String Array Into an int Array in Java

>> Convert a List of Integers to a List of Strings

>> Reading and Writing With a ConcurrentHashMap

>> Sorting a HashSet in Java

>> Java Generics PECS – Producer Extends Consumer Super

>> Guide to Java PriorityQueue

>> Difference Between Map.ofEntries() and Map.of()

>> Choosing the Right Java Collection

>> Sort Collection of Objects by Multiple Fields in Java

>> Iterate Through Two ArrayLists Simultaneously

>> Inserting an Object in an ArrayList at a Specific Position

>> Filling a List With All Enum Values in Java

>> Finding Max Date in List Using Streams

>> How to Insert a HashMap Into MongoDB With Java?

>> Slicing Arrays in Java

>> Difference Between Map and MultivaluedMap in Java

>> A Guide to LinkedHashSet in Java

>> Convert String to String Array

>> Difference Between Java Enumeration and Iterator

>> Using Streams to Collect Into a TreeSet

>> Initializing a Boolean Array in Java

>> Writing a List of Strings Into a Text File

>> Set vs List in Java

>> Convert a List to a Comma-Separated String

>> Fixed Size Queue Implementations in Java

>> Difference Between Arrays.asList() and List.of()

>> Java 8 Streams: Multiple Filters vs. Complex Condition

>> Replace Element at a Specific Index in a Java ArrayList

>> Arrays.asList() vs Collections.singletonList()

>> Implementing a Map with Multiple Keys in Java

>> Sort a List Alphabetically in Java

>> Reverse an ArrayList in Java

>> Sorting Objects in a List by Date

>> Differences Between Iterator and Iterable and How to Use Them?

>> Working With a List of Lists in Java

>> How to Store HashMap<String, ArrayList> Inside a List

>> List vs. ArrayList in Java

>> Find the Difference Between Two Sets

>> Read a File Into a Map in Java

>> How to Create a New Entry in a Map

>> Difference Between Map and HashMap in Java

>> How to Invert a Map in Java

>> Create an Empty Map in Java

>> Java ArrayIndexOutOfBoundsException

>> Java Concurrent HashSet Equivalent to ConcurrentHashMap

>> Java IdentityHashMap Class and Its Use Cases

>> Java HashMap With Different Value Types

>> Nested HashMaps Examples in Java

>> Java Map – keySet() vs. entrySet() vs. values() Methods

>> Update the Value Associated With a Key in a HashMap

>> Using a Custom Class as a Key in a Java HashMap

>> Get a Submap From a HashMap in Java

>> Collecting Stream Elements into a List in Java

>> Performance of System.arraycopy() vs. Arrays.copyOf()

>> Collection.toArray(new T[0]) or .toArray(new T[size])

>> Iterate Over a Set in Java

>> When to Use a Parallel Stream in Java

>> Convert a Java Enumeration Into a Stream

>> Returning Stream vs. Collection

>> Converting Java Properties to HashMap

>> Java Deque vs. Stack

>> Optimizing HashMap’s Performance

>> Java Warning “Unchecked Cast”

>> Java HashMap Load Factor

>> Using the Map.Entry Java Class

>> Using a Byte Array as Map Key in Java

>> Collections.synchronizedMap vs. ConcurrentHashMap

>> ArrayList vs. LinkedList vs. HashMap in Java

>> How to Access an Iteration Counter in a For Each Loop

>> The Capacity of an ArrayList vs the Size of an Array in Java

>> Creating a Generic Array in Java

>> Java IndexOutOfBoundsException “Source Does Not Fit in Dest”

>> Apache Commons Collections vs Google Guava

>> Performance of removeAll() in a HashSet

>> Reversing a Linked List in Java

>> Get the First Key and Value From a HashMap

>> Arrays.asList vs new ArrayList(Arrays.asList())

>> Assert Two Lists for Equality Ignoring Order in Java

>> A Guide to Concurrent Queues in Java

>> Finding the Differences Between Two Lists in Java

>> Converting List to Map With a Custom Supplier

>> LinkedBlockingQueue vs ConcurrentLinkedQueue

>> Mapping Lists with ModelMapper

>> Java Map With Case-Insensitive Keys

>> Java ArrayList vs LinkedList

>> Obtaining a Power Set of a Set in Java

>> Arrays.sort vs Arrays.parallelSort

>> Quick Guide to the Java Stack

>> Benchmark JDK Collections vs Eclipse Collections

>> Adding an Element to a Java Array vs an ArrayList

>> Removing an Element From an ArrayList

>> Primitive Collections in Eclipse Collections

>> Checking If an Array Is Sorted in Java

>> Converting Iterator to List

>> Checking If a List Is Sorted in Java

>> Converting Iterable to Collection in Java

>> Copying Sets in Java

>> Set Operations in Java

>> Copying a HashMap in Java

>> Map of Primitives in Java

>> Filtering a Java Collection by a List

>> Guide to Apache Commons MultiValuedMap

>> Working With Maps Using Streams

>> Determine If All Elements Are the Same in a Java List

>> Defining a Char Stack in Java

>> Map to String Conversion in Java

>> Guide to the Java Queue Interface

>> Java ArrayList vs Vector

>> Multi Dimensional ArrayList in Java

>> Immutable Set in Java

>> Differences Between HashMap and Hashtable in Java

>> Intersection of Two Lists in Java

>> Comparing Two HashMaps in Java

>> Immutable Map Implementations in Java

>> Ways to Iterate Over a List in Java

>> A Guide to EnumMap

>> Removing Elements from Java Collections

>> Converting a Collection to ArrayList in Java

>> An Introduction to Synchronized Java Collections

>> Combining Different Types of Collections in Java

>> Guide to EnumSet

>> How to Check If a Key Exists in a Map

>> Merging Two Maps with Java 8

>> Finding the Highest Value in a Java Map

>> Sort a HashMap in Java

>> Differences Between Collection.clear() and Collection.removeAll()

>> Get the Key for a Value from a Java Map

>> Time Complexity of Java Collections

>> ClassCastException: Arrays$ArrayList cannot be cast to ArrayList

>> Performance of contains() in a HashSet vs ArrayList

>> Initialize a HashMap in Java

>> Collections.emptyList() vs. New List Instance

>> Thread Safe LIFO Data Structure Implementations

>> Remove All Occurrences of a Specific Value from a List

>> Java Null-Safe Streams from Collections

>> How to Convert List to Map in Java

>> Initializing HashSet at the Time of Construction

>> An Introduction to Java.util.Hashtable Class

>> Java Collections

>> How to Store Duplicate Keys in a Map in Java?

>> How to Find an Element in a List with Java

>> Java List UnsupportedOperationException

>> Shuffling Collections In Java

>> A Guide to Iterator in Java

>> Java TreeMap vs HashMap

>> A Guide to TreeSet in Java

>> Fail-Safe Iterator vs Fail-Fast Iterator

>> A Guide to HashSet in Java

>> Apache Commons Collections Bag

>> Guide to Collections API in Vavr

>> Introduction to Eclipse Collections

>> Collect a Java Stream to an Immutable Collection

>> Introduction to PCollections

>> Guide to Apache Commons CircularFifoQueue

>> Apache Commons Collections MapUtils

>> A Guide to Apache Commons Collections CollectionUtils

>> Zipping Collections in Java

>> Apache Commons Collections BidiMap

>> Apache Commons Collections OrderedMap

>> Apache Commons Collections SetUtils

>> Guide to DelayQueue

>> Guide to CopyOnWriteArrayList

>> Guide to the ConcurrentSkipListMap

>> HashSet and TreeSet Comparison

>> Guide to the Java TransferQueue

>> A Guide to Java SynchronousQueue

>> Flattening Nested Collections in Java

>> Finding Max/Min of a List or Collection

>> Guide to WeakHashMap in Java

>> Guide to PriorityBlockingQueue in Java

>> A Guide to ConcurrentMap

>> Java Convenience Factory Methods for Collections

>> Guide to Guava Table

>> Guide to java.util.concurrent.BlockingQueue

>> A Guide to TreeMap in Java

>> A Guide to LinkedHashMap in Java

>> Guide to Guava Multimap

>> The Java HashMap Under the Hood

>> Java – Combine Multiple Collections

>> Join and Split Arrays and Collections in Java

>> Sorting in Java

>> Java Collections Interview Questions

>> A Guide to the Java LinkedList

>> Java – Get Random Item/Element From a List

>> Guide to the Java ArrayList

>> Check If Two Lists are Equal in Java

>> Guava – Join and Split Collections

>> Filtering and Transforming Collections in Guava

>> Removing all duplicates from a List in Java

>> Removing all Nulls from a List in Java

>> Convert a Map to an Array, List or Set in Java

>> Converting Between a List and a Set in Java

>> Converting Between an Array and a Set in Java

>> Converting between an Array and a List in Java

>> Immutable ArrayList in Java

>> Jackson – Unmarshall to Collection/Array

>> Partition a List in Java

>> Hamcrest Collections Cookbook

>> Guava Collections Cookbook

  • ↑ Back to Top
res – REST with Spring (eBook) (everywhere)
opt-in
Building a REST API with Spring 5?
Download the E-book
The Baeldung logo

Courses

  • All Courses
  • All Bulk Courses
  • All Bulk Team Courses
  • The Courses Platform

Series

  • Java “Back to Basics” Tutorial
  • Jackson JSON Tutorial
  • Apache HttpClient Tutorial
  • REST with Spring Tutorial
  • Spring Persistence Tutorial
  • Security with Spring
  • Spring Reactive Tutorials

About

  • About Baeldung
  • The Full Archive
  • Editors
  • Jobs
  • Our Partners
  • Partner with Baeldung
  • Terms of Service
  • Privacy Policy
  • Company Info
  • Contact
The Baeldung Logo