public AdapterDelegatesManager<T> addDelegate(@NonNull AdapterDelegate<T> delegate) {
        // algorithm could be improved since there could be holes,
        // but it's very unlikely that we reach Integer.MAX_VALUE and run out of unused indexes
        int viewType = delegates.size();
        while (delegates.get(viewType) != null) {
            viewType++;
            if (viewType == FALLBACK_DELEGATE_VIEW_TYPE) {
                throw new IllegalArgumentException(
                        "Oops, we are very close to Integer.MAX_VALUE. It seems that there are no more free and unused view type integers left to add another AdapterDelegate.");
            }
        }
        return addDelegate(viewType, false, delegate);
    }
public AdapterDelegatesManager < T > addDelegate ( @ NonNull AdapterDelegate < T > delegate ) { int viewType = delegates . size ( ) ; while ( delegates . get ( viewType ) != null ) { viewType ++ ; if ( viewType == FALLBACK_DELEGATE_VIEW_TYPE ) { throw new IllegalArgumentException ( "Oops, we are very close to Integer.MAX_VALUE. It seems that there are no more free and unused view type integers left to add another AdapterDelegate." ) ; } } return addDelegate ( viewType , false , delegate ) ; }
Adds an {@link AdapterDelegate}.
<b>This method automatically assign internally the view type integer by using the next
unused</b>
<p>
Internally calls {@link #addDelegate(int, boolean, AdapterDelegate)} with
allowReplacingDelegate = false as parameter.

@param delegate the delegate to add
@return self
@throws NullPointerException if passed delegate is null
@see #addDelegate(int, AdapterDelegate)
@see #addDelegate(int, boolean, AdapterDelegate)