ItemViewTypeComposer { public static boolean isExpandableGroup(int composedViewType) { return (composedViewType & BIT_MASK_EXPANDABLE_FLAG) != 0; } 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; 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; }
@Test public void isExpandableGroup() throws Exception { assertThat(ItemViewTypeComposer.isExpandableGroup(0), is(false)); assertThat(ItemViewTypeComposer.isExpandableGroup(ItemViewTypeComposer.BIT_MASK_SEGMENT), is(false)); assertThat(ItemViewTypeComposer.isExpandableGroup(ItemViewTypeComposer.BIT_MASK_WRAPPED_VIEW_TYPE), is(false)); assertThat(ItemViewTypeComposer.isExpandableGroup(ItemViewTypeComposer.BIT_MASK_EXPANDABLE_FLAG), is(true)); assertThat(ItemViewTypeComposer.isExpandableGroup(ItemViewTypeComposer.BIT_MASK_EXPANDABLE_FLAG | ItemViewTypeComposer.BIT_MASK_SEGMENT | ItemViewTypeComposer.BIT_MASK_WRAPPED_VIEW_TYPE), is(true)); }