Section { public View getFooterView(@SuppressWarnings("unused") final ViewGroup parent) { throw new UnsupportedOperationException( "You need to implement getFooterView() if you set footerViewWillBeProvided"); } Section(@NonNull final SectionParameters sectionParameters); final void setState(final State state); final State getState(); final boolean isVisible(); final void setVisible(final boolean visible); final boolean hasHeader(); final void setHasHeader(final boolean hasHeader); final boolean hasFooter(); final void setHasFooter(final boolean hasFooter); final boolean isItemViewWillBeProvided(); final Integer getItemResourceId(); final boolean isHeaderViewWillBeProvided(); final Integer getHeaderResourceId(); final boolean isFooterViewWillBeProvided(); final Integer getFooterResourceId(); final boolean isLoadingViewWillBeProvided(); final Integer getLoadingResourceId(); final boolean isFailedViewWillBeProvided(); final Integer getFailedResourceId(); final boolean isEmptyViewWillBeProvided(); final Integer getEmptyResourceId(); final int getSectionItemsTotal(); abstract int getContentItemsTotal(); View getItemView(@SuppressWarnings("unused") final ViewGroup parent); abstract RecyclerView.ViewHolder getItemViewHolder(View view); abstract void onBindItemViewHolder(RecyclerView.ViewHolder holder, int position); void onBindItemViewHolder(final RecyclerView.ViewHolder holder, final int position,
                                     @SuppressWarnings("unused") final List<Object> payloads); View getHeaderView(@SuppressWarnings("unused") final ViewGroup parent); RecyclerView.ViewHolder getHeaderViewHolder(final View view); @SuppressWarnings("PMD.EmptyMethodInAbstractClassShouldBeAbstract") void onBindHeaderViewHolder(final RecyclerView.ViewHolder holder); @SuppressWarnings("PMD.EmptyMethodInAbstractClassShouldBeAbstract") void onBindHeaderViewHolder(final RecyclerView.ViewHolder holder,
                                       @SuppressWarnings("unused") final List<Object> payloads); View getFooterView(@SuppressWarnings("unused") final ViewGroup parent); RecyclerView.ViewHolder getFooterViewHolder(final View view); @SuppressWarnings("PMD.EmptyMethodInAbstractClassShouldBeAbstract") void onBindFooterViewHolder(final RecyclerView.ViewHolder holder); @SuppressWarnings("PMD.EmptyMethodInAbstractClassShouldBeAbstract") void onBindFooterViewHolder(final RecyclerView.ViewHolder holder,
                                       @SuppressWarnings("unused") final List<Object> payloads); View getLoadingView(@SuppressWarnings("unused") final ViewGroup parent); RecyclerView.ViewHolder getLoadingViewHolder(final View view); @SuppressWarnings({"EmptyMethod", "PMD.EmptyMethodInAbstractClassShouldBeAbstract"}) void onBindLoadingViewHolder(@SuppressWarnings("unused") final RecyclerView.ViewHolder holder); @SuppressWarnings({"EmptyMethod", "PMD.EmptyMethodInAbstractClassShouldBeAbstract"}) void onBindLoadingViewHolder(final RecyclerView.ViewHolder holder,
                                        @SuppressWarnings("unused") final List<Object> payloads); View getFailedView(@SuppressWarnings("unused") final ViewGroup parent); RecyclerView.ViewHolder getFailedViewHolder(final View view); @SuppressWarnings({"EmptyMethod", "PMD.EmptyMethodInAbstractClassShouldBeAbstract"}) void onBindFailedViewHolder(final RecyclerView.ViewHolder holder); @SuppressWarnings({"EmptyMethod", "PMD.EmptyMethodInAbstractClassShouldBeAbstract"}) void onBindFailedViewHolder(final RecyclerView.ViewHolder holder,
                                       @SuppressWarnings("unused") final List<Object> payloads); View getEmptyView(@SuppressWarnings("unused") final ViewGroup parent); RecyclerView.ViewHolder getEmptyViewHolder(final View view); @SuppressWarnings({"EmptyMethod", "PMD.EmptyMethodInAbstractClassShouldBeAbstract"}) void onBindEmptyViewHolder(@SuppressWarnings("unused") final RecyclerView.ViewHolder holder); @SuppressWarnings({"EmptyMethod", "PMD.EmptyMethodInAbstractClassShouldBeAbstract"}) void onBindEmptyViewHolder(final RecyclerView.ViewHolder holder,
                                      @SuppressWarnings("unused") final List<Object> payloads);  }
@Test public void givenSection_whenGetFooterView_thenThrowsException() { final int itemId = 1; @SuppressWarnings("ResourceType") SectionParameters sectionParameters = SectionParameters.builder() .itemResourceId(itemId) .build(); Section section = getSection(sectionParameters); expectedException.expect(UnsupportedOperationException.class); expectedException.expectMessage("You need to implement getFooterView() if you set footerViewWillBeProvided"); section.getFooterView(null); }