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);