This needs to be rand.nextInt(max). Otherwise the last person in your list will always end up in the group of three.