### Question:
WearNotifications extends BaseNotifications { public void addSummaryActions(Builder builder, NotificationData notificationData) { NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender(); addMarkAllAsReadAction(wearableExtender, notificationData); if (isDeleteActionAvailableForWear()) { addDeleteAllAction(wearableExtender, notificationData); } Account account = notificationData.getAccount(); if (isArchiveActionAvailableForWear(account)) { addArchiveAllAction(wearableExtender, notificationData); } builder.extend(wearableExtender); } WearNotifications(NotificationController controller, NotificationActionCreator actionCreator); Notification buildStackedNotification(Account account, NotificationHolder holder); void addSummaryActions(Builder builder, NotificationData notificationData);  }### Answer:
@Test public void testAddSummaryActions() throws Exception { disableOptionalSummaryActions(); int notificationId = NotificationIds.getNewMailSummaryNotificationId(account); ArrayList<MessageReference> messageReferences = createMessageReferenceList(); NotificationData notificationData = createNotificationData(messageReferences); PendingIntent markAllAsReadPendingIntent = createFakePendingIntent(1); when(actionCreator.getMarkAllAsReadPendingIntent(account, messageReferences, notificationId)) .thenReturn(markAllAsReadPendingIntent); wearNotifications.addSummaryActions(builder, notificationData); verifyExtendWasOnlyCalledOnce(); verifyAddAction(R.drawable.ic_action_mark_as_read_dark, "Mark All Read", markAllAsReadPendingIntent); verifyNumberOfActions(1); }
@Test public void testAddSummaryActionsWithDeleteAllActionEnabled() throws Exception { enableDeleteAction(); int notificationId = NotificationIds.getNewMailSummaryNotificationId(account); ArrayList<MessageReference> messageReferences = createMessageReferenceList(); NotificationData notificationData = createNotificationData(messageReferences); PendingIntent deletePendingIntent = createFakePendingIntent(1); when(actionCreator.getDeleteAllPendingIntent(account, messageReferences, notificationId)) .thenReturn(deletePendingIntent); wearNotifications.addSummaryActions(builder, notificationData); verifyExtendWasOnlyCalledOnce(); verifyAddAction(R.drawable.ic_action_delete_dark, "Delete All", deletePendingIntent); }
@Test public void testAddSummaryActionsWithArchiveAllActionEnabled() throws Exception { enableArchiveAction(); int notificationId = NotificationIds.getNewMailSummaryNotificationId(account); ArrayList<MessageReference> messageReferences = createMessageReferenceList(); NotificationData notificationData = createNotificationData(messageReferences); PendingIntent archivePendingIntent = createFakePendingIntent(1); when(actionCreator.createArchiveAllPendingIntent(account, messageReferences, notificationId)) .thenReturn(archivePendingIntent); wearNotifications.addSummaryActions(builder, notificationData); verifyExtendWasOnlyCalledOnce(); verifyAddAction(R.drawable.ic_action_archive_dark, "Archive All", archivePendingIntent); }