LinkedHashSet
LinkedHashSet is a class in Java that is part of the Java Collections Framework. It is an implementation of the Set interface, which means it does not allow duplicate elements and does not guarantee any specific order of elements. However, unlike the HashSet class, LinkedHashSet maintains a doubly-linked list running through all of its entries, which allows it to preserve the insertion order of elements. This means that when iterating over a LinkedHashSet, the elements will be returned in the order in which they were inserted.
LinkedHashSet provides all the optional set operations, and permits null elements. It also provides constant-time performance
LinkedHashSet is typically used when the order of elements is important, such as when maintaining a cache