Add test for empty array case