private static List<Map.Entry<FutuBeacon,Double>> sortByDistance(Map<FutuBeacon,Double> unsorted){
  List<Map.Entry<FutuBeacon,Double>> list=new LinkedList<>(unsorted.entrySet());
  Collections.sort(list,null);
  return list;
}

private static List < Map . Entry < FutuBeacon , Double > > sortByDistance ( Map < FutuBeacon , Double > unsorted ) { List < Map . Entry < FutuBeacon , Double > > list = new LinkedList < > ( unsorted . entrySet ( ) ) ; Collections . sort ( list , null ) ; return list ; }
sort the list by distance .
