how do i find out if there are equal numbers in an array of random numbers(i.e. how do i knowhow many people share birthdays in an array of random birthdays?)

public static void main (String[] args){ // main method

String groups;
String people;
int b;
int n;
int random;



people = JOptionPane.showInputDialog(" How many people do u want in a group?");
groups = JOptionPane.showInputDialog(" How many groups do u want to simulate?");
b = Integer.parseInt(people);
n = Integer.parseInt(groups);


for (int count = 0; count < n; count++){

int[] array = new int[b];


for (int i = 0; i < array.length; i++) {

random = (int)(Math.random () * 365) + 1;
array[i] = random;




}



}


}


}