Adds preconditions checks similar to what is available in Guava

As requested, here are the preconditions checks and accompanying tests. Will migrate our code to use these once accepted.
nit: I like to wrap Dart reserved words, such as `false` and `null`, into backticks so they are styled like code.