Get random array function with test.