NotificationIntentProcessor { private void onNotificationDismissed() { Logger.info("Notification dismissed: %s", notificationInfo); if (intent.getExtras() != null) { PendingIntent deleteIntent = (PendingIntent) intent.getExtras().get(PushManager.EXTRA_NOTIFICATION_DELETE_INTENT); if (deleteIntent != null) { try { deleteIntent.send(); } catch (PendingIntent.CanceledException e) { Logger.debug("Failed to send notification's deleteIntent, already canceled."); } } } NotificationListener listener = airship.getPushManager().getNotificationListener(); if (listener != null) { listener.onNotificationDismissed(notificationInfo); } } NotificationIntentProcessor(@NonNull Context context, @NonNull Intent intent); @VisibleForTesting  NotificationIntentProcessor(@NonNull UAirship airship, @NonNull Context context,
                                @NonNull Intent intent, @NonNull Executor executor);   }
@Test public void testNotificationDismissed() throws ExecutionException, InterruptedException { final Boolean result = processIntent(dismissIntent); assertTrue(result); verify(context, never()).startActivity(any(Intent.class)); verify(notificationListener).onNotificationDismissed(any(NotificationInfo.class)); }