@Test public void testGetItemIdOutOfRange() { final TestAdapter adapter = new TestAdapter(context); assertThat(adapter.getItemId(-1), is(TestAdapter.NO_ID)); assertThat(adapter.getItemId(adapter.getItemCount()), is(TestAdapter.NO_ID)); }
@Override public long getItemId(final int position) { return hasItemAt(position) ? position : NO_ID; }
BaseRecyclerAdapter extends RecyclerView.Adapter<VH> implements
		DataSetAdapter<I>,
		AdapterHolder.FactoryAdapter<VH>,
		AdapterHolder.BinderAdapter<A, VH> { @Override public long getItemId(final int position) { return hasItemAt(position) ? position : NO_ID; } }
BaseRecyclerAdapter extends RecyclerView.Adapter<VH> implements
		DataSetAdapter<I>,
		AdapterHolder.FactoryAdapter<VH>,
		AdapterHolder.BinderAdapter<A, VH> { @Override public long getItemId(final int position) { return hasItemAt(position) ? position : NO_ID; } BaseRecyclerAdapter(@NonNull final Context context); }
BaseRecyclerAdapter extends RecyclerView.Adapter<VH> implements
		DataSetAdapter<I>,
		AdapterHolder.FactoryAdapter<VH>,
		AdapterHolder.BinderAdapter<A, VH> { @Override public long getItemId(final int position) { return hasItemAt(position) ? position : NO_ID; } BaseRecyclerAdapter(@NonNull final Context context); @NonNull final Context getContext(); @NonNull final Resources getResources(); @Override void registerOnDataSetListener(@NonNull final OnDataSetListener listener); @Override void unregisterOnDataSetListener(@NonNull final OnDataSetListener listener); @Override void registerOnDataSetActionListener(@NonNull final OnDataSetActionListener listener); @SuppressWarnings("SimplifiableIfStatement") boolean notifyDataSetActionSelected(final int action, final int position, @Nullable final Object payload); @Override void unregisterOnDataSetActionListener(@NonNull final OnDataSetActionListener listener); @Override boolean isEmpty(); @Override boolean isEnabled(final int position); @Override boolean hasItemAt(final int position); @Override long getItemId(final int position); @Override void setHolderFactory(@Nullable final AdapterHolder.Factory<VH> factory); @Override @Nullable AdapterHolder.Factory<VH> getHolderFactory(); @Override void setHolderBinder(@Nullable final AdapterHolder.Binder<A, VH> binder); @Override @Nullable AdapterHolder.Binder<A, VH> getHolderBinder(); @Override VH onCreateViewHolder(@NonNull final ViewGroup parent, final int viewType); @NonNull View inflateView(@LayoutRes final int resource, @Nullable final ViewGroup parent); @SuppressWarnings("unchecked") @Override void onBindViewHolder(@NonNull final VH viewHolder, final int position, @NonNull final List<Object> payloads); @SuppressWarnings("unchecked") @Override void onBindViewHolder(@NonNull final VH viewHolder, final int position); @Override @CallSuper @NonNull Parcelable saveInstanceState(); @Override @CallSuper void restoreInstanceState(@NonNull Parcelable savedState); }
BaseRecyclerAdapter extends RecyclerView.Adapter<VH> implements
		DataSetAdapter<I>,
		AdapterHolder.FactoryAdapter<VH>,
		AdapterHolder.BinderAdapter<A, VH> { @Override public long getItemId(final int position) { return hasItemAt(position) ? position : NO_ID; } BaseRecyclerAdapter(@NonNull final Context context); @NonNull final Context getContext(); @NonNull final Resources getResources(); @Override void registerOnDataSetListener(@NonNull final OnDataSetListener listener); @Override void unregisterOnDataSetListener(@NonNull final OnDataSetListener listener); @Override void registerOnDataSetActionListener(@NonNull final OnDataSetActionListener listener); @SuppressWarnings("SimplifiableIfStatement") boolean notifyDataSetActionSelected(final int action, final int position, @Nullable final Object payload); @Override void unregisterOnDataSetActionListener(@NonNull final OnDataSetActionListener listener); @Override boolean isEmpty(); @Override boolean isEnabled(final int position); @Override boolean hasItemAt(final int position); @Override long getItemId(final int position); @Override void setHolderFactory(@Nullable final AdapterHolder.Factory<VH> factory); @Override @Nullable AdapterHolder.Factory<VH> getHolderFactory(); @Override void setHolderBinder(@Nullable final AdapterHolder.Binder<A, VH> binder); @Override @Nullable AdapterHolder.Binder<A, VH> getHolderBinder(); @Override VH onCreateViewHolder(@NonNull final ViewGroup parent, final int viewType); @NonNull View inflateView(@LayoutRes final int resource, @Nullable final ViewGroup parent); @SuppressWarnings("unchecked") @Override void onBindViewHolder(@NonNull final VH viewHolder, final int position, @NonNull final List<Object> payloads); @SuppressWarnings("unchecked") @Override void onBindViewHolder(@NonNull final VH viewHolder, final int position); @Override @CallSuper @NonNull Parcelable saveInstanceState(); @Override @CallSuper void restoreInstanceState(@NonNull Parcelable savedState);  }