class LocationService {

    public synchronized void removeAll() {
        optimizer.removeAllLocations();
        repository.removeAll();
        distanceMatrix.clear();
    }

    @Autowired  LocationService(
            LocationRepository repository,
            RouteOptimizer optimizer,
            DistanceMatrix distanceMatrix,
            ApplicationEventPublisher eventPublisher);

}