use Preconditions.checkState() instead of assert