PresenterManager { public static void putViewState(@NonNull Activity activity, @NonNull String viewId, @NonNull Object viewState) { if (activity == null) { throw new NullPointerException("Activity is null"); } ActivityScopedCache scopedCache = getOrCreateActivityScopedCache(activity); scopedCache.putViewState(viewId, viewState); } private  PresenterManager(); @Nullable static P getPresenter(@NonNull Activity activity, @NonNull String viewId); @Nullable static VS getViewState(@NonNull Activity activity, @NonNull String viewId); @NonNull static Activity getActivity(@NonNull Context context); static void putPresenter(@NonNull Activity activity, @NonNull String viewId,
      @NonNull MvpPresenter<? extends MvpView> presenter); static void putViewState(@NonNull Activity activity, @NonNull String viewId,
      @NonNull Object viewState); static void remove(@NonNull Activity activity, @NonNull String viewId); static boolean DEBUG; static final String DEBUG_TAG; }
@Test public void putNullViewStateThrowNullPointerException() { Object viewState = new Object(); Activity activity = Mockito.mock(Activity.class); Application application = Mockito.mock(Application.class); Mockito.when(activity.getApplication()).thenReturn(application); try { PresenterManager.putViewState(null, "123", viewState); Assert.fail("Exception expected"); } catch (NullPointerException e) { } try { PresenterManager.putViewState(activity, null, viewState); Assert.fail("Exception expected"); } catch (NullPointerException e) { } try { PresenterManager.putViewState(activity, "123", null); Assert.fail("Exception expected"); } catch (NullPointerException e) { } }