### Question:
NotificationActivityLifecycleListener implements Application.ActivityLifecycleCallbacks { @Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) { this.counter.updateCounter(activity, true); } NotificationActivityLifecycleListener(@NonNull final NotificationPressedInterceptorCounter counter); @Override void onActivityCreated(Activity activity, Bundle savedInstanceState); @Override void onActivityStarted(final Activity activity); @Override void onActivityResumed(Activity activity); @Override void onActivityPaused(Activity activity); @Override void onActivityStopped(final Activity activity); @Override void onActivitySaveInstanceState(Activity activity, Bundle outState); @Override void onActivityDestroyed(Activity activity);  }### Answer:
@Test public void onActivityCreated() throws Exception { final Activity mockActivity = mock(Activity.class); final NotificationPressedInterceptorCounter mockCounter = mock(NotificationPressedInterceptorCounter.class); final NotificationActivityLifecycleListener lifecycleListener = new NotificationActivityLifecycleListener(mockCounter); lifecycleListener.onActivityCreated(mockActivity, null); verify(mockCounter).updateCounter(mockActivity, true); }