LocationService { public synchronized boolean addLocation(Location location) { return submitToPlanner(Objects.requireNonNull(location)); } @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 addLocation_should_validate_arguments() { assertThatNullPointerException().isThrownBy(() -> locationService.addLocation(null)); }
@Test void addLocation(@Mock DistanceMatrixRow matrixRow) { when(distanceMatrix.addLocation(any())).thenReturn(matrixRow); assertThat(locationService.addLocation(location)).isTrue(); verifyNoInteractions(repository); verify(distanceMatrix).addLocation(location); verify(optimizer).addLocation(location, matrixRow); }