PowerAdapter { @CallSuper public void registerDataObserver(@NonNull DataObserver dataObserver) { checkNotNull(dataObserver, "dataObserver"); mDataObservable.registerObserver(dataObserver); if (mDataObservable.getObserverCount() == 1) { onFirstObserverRegistered(); } }  abstract int getItemCount(); boolean hasStableIds(); long getItemId(int position); @NonNull Object getItemViewType(int position); boolean isEnabled(int position); @NonNull abstract View newView(@NonNull ViewGroup parent, @NonNull Object viewType); abstract void bindView(
            @NonNull Container container,
            @NonNull View view,
            @NonNull Holder holder,
            @NonNull List<Object> payloads
    ); @CallSuper void registerDataObserver(@NonNull DataObserver dataObserver); @CallSuper void unregisterDataObserver(@NonNull DataObserver dataObserver); @CheckResult @NonNull final PowerAdapter compose(@NonNull Transformer transformer); @CheckResult @NonNull final PowerAdapter prepend(@NonNull PowerAdapter... adapters); @CheckResult @NonNull final PowerAdapter prepend(@NonNull ViewFactory... views); @CheckResult @NonNull final PowerAdapter prepend(@NonNull @LayoutRes int... layoutResources); @CheckResult @NonNull final PowerAdapter append(@NonNull PowerAdapter... adapters); @CheckResult @NonNull final PowerAdapter append(@NonNull ViewFactory... views); @CheckResult @NonNull final PowerAdapter append(@NonNull @LayoutRes int... layoutResources); @CheckResult @NonNull final PowerAdapter offset(int offset); @CheckResult @NonNull final PowerAdapter limit(int limit); @CheckResult @NonNull final PowerAdapter showOnlyWhile(@NonNull Condition condition); @CheckResult @NonNull PowerAdapter wrapItems(@NonNull ViewFactory wrapperView); @CheckResult @NonNull PowerAdapter wrapItems(@LayoutRes int wrapperLayoutResource); @CheckResult @NonNull static PowerAdapter concat(@NonNull PowerAdapter... adapters); @CheckResult @NonNull static PowerAdapter concat(@NonNull Collection<? extends PowerAdapter> adapters); @CheckResult @NonNull static PowerAdapter concat(@NonNull Iterable<? extends PowerAdapter> adapters); @CheckResult @NonNull static PowerAdapter asAdapter(@NonNull ViewFactory... views); @CheckResult @NonNull static PowerAdapter asAdapter(@NonNull Iterable<? extends ViewFactory> views); @CheckResult @NonNull static PowerAdapter asAdapter(@NonNull Collection<? extends ViewFactory> views); @CheckResult @NonNull static PowerAdapter asAdapter(@NonNull @LayoutRes int... resources); static final PowerAdapter EMPTY; static final int NO_ID; }
@Test(expected = IllegalStateException.class) public void doubleRegistrationThrows() { DataObserver observer = mock(DataObserver.class); mAdapter.registerDataObserver(observer); mAdapter.registerDataObserver(observer); }