DebugWrapperAdapter extends SimpleWrapperAdapter<RecyclerView.ViewHolder> { public void setSettingFlags(@DebugWrapperAdapterSettingFlags int flags) { mFlags = flags; } @SuppressWarnings("unchecked")  DebugWrapperAdapter(@NonNull RecyclerView.Adapter adapter); @Override int wrapPosition(@NonNull AdapterPathSegment pathSegment, int position); @Override void unwrapPosition(@NonNull UnwrapPositionResult dest, int position); @DebugWrapperAdapterSettingFlags int getSettingFlags(); void setSettingFlags(@DebugWrapperAdapterSettingFlags int flags); static final int FLAG_VERIFY_WRAP_POSITION; static final int FLAG_VERIFY_UNWRAP_POSITION; static final int FLAGS_ALL_DEBUG_FEATURES; }
@Test public void setSettingFlags() throws Exception { RecyclerView.Adapter adapter = new TestAdapter(); DebugWrapperAdapter debugAdapter = new DebugWrapperAdapter(adapter); debugAdapter.setSettingFlags(0); debugAdapter.setSettingFlags(DebugWrapperAdapter.FLAG_VERIFY_WRAP_POSITION); debugAdapter.setSettingFlags(DebugWrapperAdapter.FLAG_VERIFY_UNWRAP_POSITION); debugAdapter.setSettingFlags(DebugWrapperAdapter.FLAGS_ALL_DEBUG_FEATURES); }