We have some code which sorts a list of addresses based on the distance between their coordinates. this is done through collections.sort with a custom comparator.
How
Handle it like null means infinitely far away. Thus:
null
comp(1234, null) == -1
comp(null, null) == 0
comp(null, 1234) == 1
With this, you get a consistent ordering.