HBASE-12062 Fix usage of Collections.toArray