Used Guava to check preconditions.