code: public AdapterDelegatesManager<T> addDelegate(int viewType, boolean allowReplacingDelegate,
                                                    @NonNull AdapterDelegate<T> delegate) {
  
          if (delegate == null) {
              throw new NullPointerException("AdapterDelegate is null!");
          }
  
          if (viewType == FALLBACK_DELEGATE_VIEW_TYPE) {
              throw new IllegalArgumentException("The view type = "
                      + FALLBACK_DELEGATE_VIEW_TYPE
                      + " is reserved for fallback adapter delegate (see setFallbackDelegate() ). Please use another view type.");
          }
  
          if (!allowReplacingDelegate && delegates.get(viewType) != null) {
              throw new IllegalArgumentException(
                      "An AdapterDelegate is already registered for the viewType = "
                              + viewType
                              + ". Already registered AdapterDelegate is "
                              + delegates.get(viewType));
          }
  
          delegates.put(viewType, delegate);
  
          return this;
      }
docs: Adds an {@link AdapterDelegate}.
  
  @param viewType               The viewType id
  @param allowReplacingDelegate if true, you allow to replacing the given delegate any previous
  delegate for the same view type. if false, you disallow and a {@link IllegalArgumentException}
  will be thrown if you try to replace an already registered {@link AdapterDelegate} for the
  same view type.
  @param delegate               The delegate to add
  @throws IllegalArgumentException if <b>allowReplacingDelegate</b>  is false and an {@link
  AdapterDelegate} is already added (registered)
  with the same ViewType.
  @throws IllegalArgumentException if viewType is {@link #FALLBACK_DELEGATE_VIEW_TYPE} which is
  reserved
  @see #addDelegate(AdapterDelegate)
  @see #addDelegate(int, AdapterDelegate)
  @see #setFallbackDelegate(AdapterDelegate)