LocationService { public synchronized void removeAll() { optimizer.removeAllLocations(); repository.removeAll(); distanceMatrix.clear(); } @Autowired  LocationService(
            LocationRepository repository,
            RouteOptimizer optimizer,
            DistanceMatrix distanceMatrix,
            ApplicationEventPublisher eventPublisher); synchronized boolean createLocation(Coordinates coordinates, String description); synchronized boolean addLocation(Location location); synchronized void removeLocation(long id); synchronized void removeAll();  }
@Test void clear() { locationService.removeAll(); verify(optimizer).removeAllLocations(); verify(repository).removeAll(); verify(distanceMatrix).clear(); }