@Test public void addManager_AddsManagerToMap() { mDiffRequestManagerHolder.addManager(mDiffRequestManager, "TEST_TAG2"); assertThat(mDiffRequestManagers.size(), equalTo(2)); }
void addManager(@NonNull final DiffRequestManager manager, @NonNull final String tag) { checkNotNull(manager, "manager must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); mDiffRequestManagers.put(tag, manager); }
DiffRequestManagerHolder { void addManager(@NonNull final DiffRequestManager manager, @NonNull final String tag) { checkNotNull(manager, "manager must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); mDiffRequestManagers.put(tag, manager); } }
DiffRequestManagerHolder { void addManager(@NonNull final DiffRequestManager manager, @NonNull final String tag) { checkNotNull(manager, "manager must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); mDiffRequestManagers.put(tag, manager); } DiffRequestManagerHolder(@NonNull final Map<String, DiffRequestManager> managers); }
DiffRequestManagerHolder { void addManager(@NonNull final DiffRequestManager manager, @NonNull final String tag) { checkNotNull(manager, "manager must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); mDiffRequestManagers.put(tag, manager); } 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 { void addManager(@NonNull final DiffRequestManager manager, @NonNull final String tag) { checkNotNull(manager, "manager must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); mDiffRequestManagers.put(tag, manager); } 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);  }