added unit test for having.