DebugWrapperAdapter extends SimpleWrapperAdapter<RecyclerView.ViewHolder> { @DebugWrapperAdapterSettingFlags public int getSettingFlags() { return mFlags; } @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 getSettingFlags() throws Exception { RecyclerView.Adapter adapter = new TestAdapter(); DebugWrapperAdapter debugAdapter = new DebugWrapperAdapter(adapter); assertThat(debugAdapter.getSettingFlags(), is(DebugWrapperAdapter.FLAGS_ALL_DEBUG_FEATURES)); debugAdapter.setSettingFlags(0); assertThat(debugAdapter.getSettingFlags(), is(0)); debugAdapter.setSettingFlags(DebugWrapperAdapter.FLAG_VERIFY_WRAP_POSITION); assertThat(debugAdapter.getSettingFlags(), is(DebugWrapperAdapter.FLAG_VERIFY_WRAP_POSITION)); }