SessionRecyclerAdapter extends CardRecyclerAdapter { int findThisDevicePos() { return notifications.size() + ((folderHeader != null) ? 1 : 0) + folderItems.size() + ((deviceHeader != null) ? 1 : 0) ; } 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 testfindThisDevicePos() { List<NotifCard> notifs = new LinkedList<>(); notifs.add(new NotifCardRestart(null)); notifs.add(new NotifCardRestart(null)); adapter.setNotifications(notifs, false); List<FolderCard> folders = new LinkedList<>(); folders.add(new FolderCard(null, null, null)); folders.add(new FolderCard(null, null, null)); folders.add(new FolderCard(null, null, null)); adapter.setFolders(folders, false); int loc = adapter.findThisDevicePos(); assertEquals(loc, 7); }