Reuse ArrayUtils::pickRandom rather than copy pasta code

https://gerrit.wikimedia.org/r/#/c/51322/
https://gerrit.wikimedia.org/r/#/c/52298/

Change-Id: I0ce0bdb69f38f8f778e336894ed34998fc65a2a0
Merge "Reuse ArrayUtils::pickRandom rather than copy pasta code"