This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I think the compare method written in the code is wrong. According to the specification it should return a negative int / zero or a positive int. But it just assigns the given a's dish value to b and returns it.
I have modified the compare() method and added some System.out.println() and two more objects in the array in the code shown below.
Note that binarySearch() method uses the comparator to find the object.