ArrayIndexOutOfBoundException fixed in getGroupnames(Integer[]).