Disclaimer: Did not even bother to compile this and omit any error handling:
/*Returns the equal count in int[0] and nonEqualCount in int[1] of the result*/
public static int[] findEqualAndNotEqual(Integer firstArray, Integer secondArray){
Set set = new HashSet(Arrays.asList(firstArray));
int equalCount = 0;
int nonEqualCount = 0;
for(Integer num:secondArray){
if(set.contains(num)){
equalCount++;
}
else{
nonEqualCount++;
}
}
return new int[]{equalCount, nonEqualCount};
}