Collections Framework (JDK 1.2) là kiến trúc thống nhất để lưu và thao tác nhóm object.
Cấu trúc interface (đơn giản hoá):
Collection<E>
├── List<E> — có thứ tự, cho phép trùng → ArrayList, LinkedList
├── Set<E> — không trùng → HashSet, LinkedHashSet, TreeSet
└── Queue<E> — FIFO/priority → ArrayDeque, PriorityQueue
Map<K,V> — KHÔNG extend Collection → HashMap, LinkedHashMap, TreeMap3 tầng: Interface (contract) → Implementation (cụ thể) → Utility (Collections.sort(), Collections.unmodifiableList()...).
Lợi ích: type-safe với generics (Java 5+), API nhất quán, polymorphism (đổi implementation dễ).
Java 9+ factory ngắn gọn:
java
List<Integer> nums = List.of(1, 2, 3); // immutable
Map<String, Integer> ages = Map.of("Ada", 30); // immutable⚠ List.of(...) immutable — add() throw UnsupportedOperationException. Cần mutable thì new ArrayList<>(List.of(...)).
Concurrent variants: ConcurrentHashMap, CopyOnWriteArrayList, BlockingQueue (multi-thread).