private void checkDeleteLocation(LocationId locationId) { boolean hasNoOrgs = locationRepository.checkBusinessUnits(locationId); if (!hasNoOrgs) { throw new IllegalArgumentException("cannot delete location with associated business units"); } boolean hasNoPositions = locationRepository.checkPositions(locationId); if (!hasNoPositions) { throw new IllegalArgumentException("cannot delete location with associated positions"); } }