@Test void createLocation_should_validate_arguments() { assertThatNullPointerException().isThrownBy(() -> locationService.createLocation(null, "x")); assertThatNullPointerException().isThrownBy(() -> locationService.createLocation(coordinates, null)); }
public synchronized boolean createLocation(Coordinates coordinates, String description) { Objects.requireNonNull(coordinates); Objects.requireNonNull(description); return submitToPlanner(repository.createLocation(coordinates, description)); }
LocationService { public synchronized boolean createLocation(Coordinates coordinates, String description) { Objects.requireNonNull(coordinates); Objects.requireNonNull(description); return submitToPlanner(repository.createLocation(coordinates, description)); } }
LocationService { public synchronized boolean createLocation(Coordinates coordinates, String description) { Objects.requireNonNull(coordinates); Objects.requireNonNull(description); return submitToPlanner(repository.createLocation(coordinates, description)); } @Autowired  LocationService(
            LocationRepository repository,
            RouteOptimizer optimizer,
            DistanceMatrix distanceMatrix,
            ApplicationEventPublisher eventPublisher); }
LocationService { public synchronized boolean createLocation(Coordinates coordinates, String description) { Objects.requireNonNull(coordinates); Objects.requireNonNull(description); return submitToPlanner(repository.createLocation(coordinates, description)); } @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(); }
LocationService { public synchronized boolean createLocation(Coordinates coordinates, String description) { Objects.requireNonNull(coordinates); Objects.requireNonNull(description); return submitToPlanner(repository.createLocation(coordinates, description)); } @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();  }