@Test public void getManager_ReturnsNonNullManager() { final DiffRequestManager diffRequestManager = mDiffRequestManagerHolder.getManager(TEST_TAG); assertThat(diffRequestManager, notNullValue()); }
@NonNull public DiffRequestManager getManager(@NonNull final String tag) { checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); final DiffRequestManager diffRequestManager = mDiffRequestManagers.get(tag); if (diffRequestManager == null) { throw new IllegalStateException("Failed to retrieve the manager matching the given tag. Probably you forgot to bind it to an activity."); } return diffRequestManager; }
DiffRequestManagerHolder { @NonNull public DiffRequestManager getManager(@NonNull final String tag) { checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); final DiffRequestManager diffRequestManager = mDiffRequestManagers.get(tag); if (diffRequestManager == null) { throw new IllegalStateException("Failed to retrieve the manager matching the given tag. Probably you forgot to bind it to an activity."); } return diffRequestManager; } }
DiffRequestManagerHolder { @NonNull public DiffRequestManager getManager(@NonNull final String tag) { checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); final DiffRequestManager diffRequestManager = mDiffRequestManagers.get(tag); if (diffRequestManager == null) { throw new IllegalStateException("Failed to retrieve the manager matching the given tag. Probably you forgot to bind it to an activity."); } return diffRequestManager; } DiffRequestManagerHolder(@NonNull final Map<String, DiffRequestManager> managers); }
DiffRequestManagerHolder { @NonNull public DiffRequestManager getManager(@NonNull final String tag) { checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); final DiffRequestManager diffRequestManager = mDiffRequestManagers.get(tag); if (diffRequestManager == null) { throw new IllegalStateException("Failed to retrieve the manager matching the given tag. Probably you forgot to bind it to an activity."); } return diffRequestManager; } DiffRequestManagerHolder(@NonNull final Map<String, DiffRequestManager> managers); @NonNull static DiffRequestManagerHolder create(); @NonNull DiffRequestManager<D, A> with(@NonNull final A adapter); @NonNull DiffRequestManager<D, A> with(@NonNull final A adapter, @NonNull final String tag); @NonNull DiffRequestManager getDefaultManager(); @NonNull DiffRequestManager getManager(@NonNull final String tag); }
DiffRequestManagerHolder { @NonNull public DiffRequestManager getManager(@NonNull final String tag) { checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); final DiffRequestManager diffRequestManager = mDiffRequestManagers.get(tag); if (diffRequestManager == null) { throw new IllegalStateException("Failed to retrieve the manager matching the given tag. Probably you forgot to bind it to an activity."); } return diffRequestManager; } DiffRequestManagerHolder(@NonNull final Map<String, DiffRequestManager> managers); @NonNull static DiffRequestManagerHolder create(); @NonNull DiffRequestManager<D, A> with(@NonNull final A adapter); @NonNull DiffRequestManager<D, A> with(@NonNull final A adapter, @NonNull final String tag); @NonNull DiffRequestManager getDefaultManager(); @NonNull DiffRequestManager getManager(@NonNull final String tag);  }