@Test public void extractWrappedViewTypePart() throws Exception { assertThat(ItemViewTypeComposer.extractWrappedViewTypePart(0), is(0)); assertThat(ItemViewTypeComposer.extractWrappedViewTypePart(1 << ItemViewTypeComposer.BIT_OFFSET_WRAPPED_VIEW_TYPE), is(1)); assertThat(ItemViewTypeComposer.extractWrappedViewTypePart(ItemViewTypeComposer.BIT_MASK_WRAPPED_VIEW_TYPE), is(-1)); assertThat(ItemViewTypeComposer.extractWrappedViewTypePart(ItemViewTypeComposer.MIN_WRAPPED_VIEW_TYPE << ItemViewTypeComposer.BIT_OFFSET_WRAPPED_VIEW_TYPE), is(ItemViewTypeComposer.MIN_WRAPPED_VIEW_TYPE)); assertThat(ItemViewTypeComposer.extractWrappedViewTypePart(ItemViewTypeComposer.MAX_WRAPPED_VIEW_TYPE << ItemViewTypeComposer.BIT_OFFSET_WRAPPED_VIEW_TYPE), is(ItemViewTypeComposer.MAX_WRAPPED_VIEW_TYPE)); assertThat(ItemViewTypeComposer.extractWrappedViewTypePart(ItemViewTypeComposer.BIT_MASK_EXPANDABLE_FLAG), is(0)); assertThat(ItemViewTypeComposer.extractWrappedViewTypePart(ItemViewTypeComposer.BIT_MASK_SEGMENT), is(0)); }
@IntRange(from = MIN_WRAPPED_VIEW_TYPE, to = MAX_WRAPPED_VIEW_TYPE) public static int extractWrappedViewTypePart(int composedViewType) { return (composedViewType << (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE - BIT_OFFSET_WRAPPED_VIEW_TYPE)) >> (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE); }
ItemViewTypeComposer { @IntRange(from = MIN_WRAPPED_VIEW_TYPE, to = MAX_WRAPPED_VIEW_TYPE) public static int extractWrappedViewTypePart(int composedViewType) { return (composedViewType << (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE - BIT_OFFSET_WRAPPED_VIEW_TYPE)) >> (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE); } }
ItemViewTypeComposer { @IntRange(from = MIN_WRAPPED_VIEW_TYPE, to = MAX_WRAPPED_VIEW_TYPE) public static int extractWrappedViewTypePart(int composedViewType) { return (composedViewType << (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE - BIT_OFFSET_WRAPPED_VIEW_TYPE)) >> (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE); } private  ItemViewTypeComposer(); }
ItemViewTypeComposer { @IntRange(from = MIN_WRAPPED_VIEW_TYPE, to = MAX_WRAPPED_VIEW_TYPE) public static int extractWrappedViewTypePart(int composedViewType) { return (composedViewType << (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE - BIT_OFFSET_WRAPPED_VIEW_TYPE)) >> (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE); } private  ItemViewTypeComposer(); @IntRange(from = MIN_SEGMENT, to = MAX_SEGMENT) static int extractSegmentPart(int composedViewType); @IntRange(from = MIN_WRAPPED_VIEW_TYPE, to = MAX_WRAPPED_VIEW_TYPE) static int extractWrappedViewTypePart(int composedViewType); static boolean isExpandableGroup(int composedViewType); static int composeSegment(@IntRange(from = MIN_SEGMENT, to = MAX_SEGMENT) int segment, int wrappedViewType); }
ItemViewTypeComposer { @IntRange(from = MIN_WRAPPED_VIEW_TYPE, to = MAX_WRAPPED_VIEW_TYPE) public static int extractWrappedViewTypePart(int composedViewType) { return (composedViewType << (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE - BIT_OFFSET_WRAPPED_VIEW_TYPE)) >> (32 - BIT_WIDTH_WRAPPED_VIEW_TYPE); } private  ItemViewTypeComposer(); @IntRange(from = MIN_SEGMENT, to = MAX_SEGMENT) static int extractSegmentPart(int composedViewType); @IntRange(from = MIN_WRAPPED_VIEW_TYPE, to = MAX_WRAPPED_VIEW_TYPE) static int extractWrappedViewTypePart(int composedViewType); static boolean isExpandableGroup(int composedViewType); static int composeSegment(@IntRange(from = MIN_SEGMENT, to = MAX_SEGMENT) int segment, int wrappedViewType); static final int BIT_OFFSET_EXPANDABLE_FLAG; static final int BIT_OFFSET_SEGMENT; static final int BIT_OFFSET_WRAPPED_VIEW_TYPE; static final int BIT_WIDTH_EXPANDABLE_FLAG; static final int BIT_WIDTH_SEGMENT; static final int BIT_WIDTH_WRAPPED_VIEW_TYPE; @SuppressWarnings("NumericOverflow")
    static final int BIT_MASK_EXPANDABLE_FLAG; static final int BIT_MASK_SEGMENT; static final int BIT_MASK_WRAPPED_VIEW_TYPE; static final int MIN_SEGMENT; static final int MAX_SEGMENT; static final int MIN_WRAPPED_VIEW_TYPE; static final int MAX_WRAPPED_VIEW_TYPE; }