Android. Sort list of objects by its rating

Sort by rating

//Seperate class
public class DrugstoreRatingComparator implements Comparator<Drugstore> {
    public int compare(Drugstore d1, Drugstore d2) {
        double difference = d2.getRating()*10 - d1.getRating()*10;
        int x = (int) difference;
        return x;
    }
}
...
//USAGE
        Collections.sort(topDrugstoresList,
                new DrugstoreRatingComparator());