TDD optimizer cardinality tests

Tests to see if the optimizer knows the cardinality of the objects.