SessionRecyclerAdapter extends CardRecyclerAdapter { int findFolderOffset(int index) { index = findNotificationOffset(index); if (!notifications.isEmpty()) { index += notifications.size(); } if (folderHeader != null) { index++; } return index; } SessionRecyclerAdapter(SessionPresenter presenter);   SessionRecyclerAdapter(); @Override android.databinding.DataBindingComponent getBindingComponent(); @Override void applyAdditionalBinding(Card card, CardViewHolder holder); void setNotifications(List<NotifCard> notifs, boolean notify); void setFolders(List<FolderCard> folders, boolean notify); void setThisDevice(MyDeviceCard myDevice, boolean notify); void setDevices(List<DeviceCard> devices, boolean notify); Card getItem(int pos); @Override int getItemCount(); @Override long getItemId(int position);  }
@Test public void testFindFolderOffset() { List<NotifCard> notifs = new LinkedList<>(); notifs.add(new NotifCardRestart(null)); notifs.add(new NotifCardRestart(null)); adapter.setNotifications(notifs, false); int loc = adapter.findFolderOffset(0); assertEquals(loc, 3); }