Java
Checked & Unchecked Exceptions
http://tutorials.jenkov.com/java-exception-handling/checked-or-unchecked-exceptions.html
- Checked exceptions require
throws
all the way up the call stack, but unchecked exceptions don’t. NullPointerException
s are unchecked.Error
and subclasses are unchecked.- Unchecked exceptions inherit from
RuntimeException
, checked exceptions inherit fromException
.
Guava
https://github.com/google/guava/wiki
Guava has a lot of stuff, but some highlights:
Optional<T>
type- Immutable collections (List, Set, Map, etc.)
- More collections:
- Multiset: set that allows multiples
- Multimap: map for unique values to a collection of values
- BiMap: reversable map
- Graphs
- Caches
- LoadingCache: use a
CacheLoader
to load the cache; allget
s will block until the cache is loaded. - Eviction based on size/time. Also by (weak) references.
- LoadingCache: use a
- Bloom filters
- Event bus: multiple producers/consumers can communicate via the event bus (and not necessarily know about each other)