Made tests for empty collection and non-existing object