@SuppressWarnings("ConstantConditions") @Test public void testRemoveHeader() { final TestModule module = new TestModule(); for (int i = 0; i < 10; i++) { module.putHeader(i, createTestHeader("Header for: " + i)); } for (int i = 9; i >= 0; i--) { final HeadersModule.Header header = module.removeHeader(i); assertThat(header, is(notNullValue())); assertThat(header.getText(), Is.<CharSequence>is("Header for: " + i)); assertThat(module.getHeader(i), is(nullValue())); } assertThat(module.isEmpty(), is(true)); assertThat(module.size(), is(0)); }
@Nullable protected H removeHeader(final int position) { final H header = headers.get(position); this.headers.remove(position); return header; }
HeadersModule extends AdapterModule { @Nullable protected H removeHeader(final int position) { final H header = headers.get(position); this.headers.remove(position); return header; } }
HeadersModule extends AdapterModule { @Nullable protected H removeHeader(final int position) { final H header = headers.get(position); this.headers.remove(position); return header; }  }
HeadersModule extends AdapterModule { @Nullable protected H removeHeader(final int position) { final H header = headers.get(position); this.headers.remove(position); return header; }  boolean isEmpty(); int size(); boolean isHeaderAt(final int position); @Nullable H getHeader(final int position); @NonNull SparseArray<H> getHeaders(); void clearHeaders(); int correctPosition(final int position); int countHeadersBeforePosition(final int position); void setHeaderStyleAttr(@AttrRes final int styleAttr); @AttrRes int getHeaderStyleAttr(); @NonNull abstract VH createViewHolder(@NonNull ViewGroup parent, int viewType); @NonNull final SimpleHeaderHolder createSimpleHeaderHolder(@NonNull ViewGroup parent); abstract void bindViewHolder(@NonNull VH viewHolder, int position); }
HeadersModule extends AdapterModule { @Nullable protected H removeHeader(final int position) { final H header = headers.get(position); this.headers.remove(position); return header; }  boolean isEmpty(); int size(); boolean isHeaderAt(final int position); @Nullable H getHeader(final int position); @NonNull SparseArray<H> getHeaders(); void clearHeaders(); int correctPosition(final int position); int countHeadersBeforePosition(final int position); void setHeaderStyleAttr(@AttrRes final int styleAttr); @AttrRes int getHeaderStyleAttr(); @NonNull abstract VH createViewHolder(@NonNull ViewGroup parent, int viewType); @NonNull final SimpleHeaderHolder createSimpleHeaderHolder(@NonNull ViewGroup parent); abstract void bindViewHolder(@NonNull VH viewHolder, int position);  }