         }
     }
     
-    private func scheduleNotificationForNextReviewCount(resourceRepository: ResourceRepositoryReader) throws -> Bool {
+    private func scheduleNotificationForNextReviewCount(resourceRepository: ResourceRepositoryReader, deliveredNotification notification: UNNotification) throws -> Bool {
         guard try resourceRepository.hasReviewTimeline() else {
             return false
         }

        }
        
        let currentReviewCount = reviewTimeline[..<nextReviewIndex].lazy.map({ $0.itemCounts.total }).reduce(0, +)
        let nextReview = reviewTimeline[nextReviewIndex]
        
        let nextReviewCount = currentReviewCount + nextReview.itemCounts.total
        os_log("Next review notification scheduled for %d items", type: .debug, nextReviewCount)
        
        let reviewNotificationText = notificationText(forCount: nextReviewCount)
        scheduleNotification(body: reviewNotificationText, at: nextReview.dateAvailable, includeSound: false)
        
        return true
    }

        scheduleNotification(content: content, identifier: .badge(badgeNumber), at: date)
    }
    
    private func scheduleNotification(body: String, at date: Date? = nil, includeSound: Bool = true) {
        if let date = date {
            os_log("Scheduling local notification at %@", type: .debug, date as NSDate)
        } else {
            os_log("Scheduling immediate local notification", type: .debug)
        }
        
        let content = UNMutableNotificationContent()
        content.body = body
