Fiserv interview question

Second highest salary from array with 3 types of logic using java