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.