public static Integer getNumberThree(Integer[] intarray,Integer number){
int index = Math.abs(number-intarray[0]);
int result = intarray[0];
for (int i : intarray) {
int abs = Math.abs(number-i);
if(abs <= index){
index = abs;
result = i;
}
}
return result;
}