added unit tests for isEmpty and nonEmpty