@Test
void distance_to_location_should_equal_value_in_distance_map() {

    HashMap<Long, Distance> distanceMap = new HashMap<>();
    long otherId = 321;
    long millis = 777777;
    distanceMap.put(otherId, Distance.ofMillis(millis));
    Location domainLocation = new Location(1, Coordinates.valueOf(0, 0));
    PlanningLocation planningLocation = new PlanningLocation(
            domainLocation.id(),
            domainLocation.coordinates().latitude().doubleValue(),
            domainLocation.coordinates().longitude().doubleValue(),
            new DistanceMapImpl(distanceMap::get));
    assertThat(planningLocation.distanceTo(testLocation(otherId))).isEqualTo(millis);
}