The four core single-method interfaces in `java.util.function`. They're the parameter types for streams, Optional methods, CompletableFuture, and countless library APIs.
Multi-line string literals with proper indentation handling. Stop concatenating newlines by hand. The compiler removes the common leading whitespace automatically.
The default thread-safe map. Better than `Collections.synchronizedMap` — segmented locking allows multiple readers AND writers. Use `compute`, `merge`, `putIfAbsent` for atomic compound updates.
Block one or more threads until a count of events occurs. Set the count up front; each event calls `countDown()`; waiters call `await()`. Classic "wait until all workers are ready" pattern.
Java 8's `java.time` package replaced the broken `Date`/`Calendar`. Three types you actually use: `Instant` (UTC moment), `LocalDate` (date with no tz), `ZonedDateTime` (date+time in a zone).
`com.fasterxml.jackson.databind.ObjectMapper` is the JSON standard for Java. Construct once (it's expensive + thread-safe) and reuse for every serialization in your app.
Producer-Extends, Consumer-Super. `? extends T` is read-only (you can take items OUT). `? super T` is write-only (you can put items IN). Lets generic APIs accept a wider range of types.
`Path` (NIO) replaces `File` for new code. Operator-like methods compose paths cleanly across OSes — and the underlying file isn't touched until you do I/O.
`Duration` for elapsed time (hours/minutes/seconds). `Period` for calendar amounts (days/months/years). Don't mix — calendar math respects month lengths and DST; clock math doesn't.
Java Collectors.partitioningBy — Split by Predicate
Special case of groupingBy when the key is boolean — returns a `Map<Boolean, List<T>>` for the "true" and "false" buckets. Slightly more efficient than groupingBy.
`Optional::stream` (Java 9+) bridges optionals into the Stream API — collect all the `Some` values from a list of optionals, drop the empties, in one pipeline.
`toMap` builds a `Map<K, V>` from a stream. The 3-arg form takes a merge function for handling duplicate keys — without it, duplicates throw IllegalStateException.
Build streams from a seed + a function. `generate(supplier)` calls the supplier each time; `iterate(seed, next)` applies a unary op. Always pair with `limit` to bound them.