### Question:
TextListItem extends ListItem<TextListItem.ViewHolder> { public void setTitle(String title) { mTitle = title; markDirty(); } TextListItem(Context context); static ViewHolder createViewHolder(View itemView); @Override int getViewType(); @Override void onBind(ViewHolder viewHolder); void setOnClickListener(View.OnClickListener listener); void setPrimaryActionIcon(@DrawableRes int iconResId, boolean useLargeIcon); void setPrimaryActionIcon(Drawable drawable, boolean useLargeIcon); void setPrimaryActionEmptyIcon(); void setPrimaryActionNoIcon(); void setTitle(String title); void setBody(String body); void setBody(String body, boolean asPrimary); void setSupplementalIcon(int iconResId, boolean showDivider); void setSupplementalIcon(Drawable drawable, boolean showDivider); void setSupplementalIcon(int iconResId, boolean showDivider,
            View.OnClickListener listener); void setSupplementalIcon(Drawable drawable, boolean showDivider,
            View.OnClickListener listener); void setAction(String text, boolean showDivider, View.OnClickListener listener); void setActions(String action1Text, boolean showAction1Divider,
            View.OnClickListener action1OnClickListener,
            String action2Text, boolean showAction2Divider,
            View.OnClickListener action2OnClickListener); void setSwitch(boolean checked, boolean showDivider,
            CompoundButton.OnCheckedChangeListener listener); void setSwitchState(boolean isChecked);  }### Answer:
@Test public void testItemWithOnlyTitleIsSingleLine() { TextListItem item0 = new TextListItem(mActivity); item0.setTitle(" "); TextListItem item1 = new TextListItem(mActivity); item1.setTitle("______"); TextListItem item2 = new TextListItem(mActivity); item2.setTitle("ALL UPPER CASE"); TextListItem item3 = new TextListItem(mActivity); item3.setTitle(InstrumentationRegistry.getContext().getResources().getString( R.string.over_uxr_text_length_limit)); List<TextListItem> items = Arrays.asList(item0, item1, item2, item3); setupPagedListView(items); double singleLineHeight = InstrumentationRegistry.getContext().getResources().getDimension( R.dimen.car_single_line_list_item_height); LinearLayoutManager layoutManager = (LinearLayoutManager) mPagedListView.getRecyclerView().getLayoutManager(); for (int i = 0; i < items.size(); i++) { assertThat((double) layoutManager.findViewByPosition(i).getHeight(), is(closeTo(singleLineHeight, 1.0d))); } }
@Test public void testUpdateItem() { TextListItem item = new TextListItem(mActivity); setupPagedListView(Arrays.asList(item)); String title = "updated title"; item.setTitle(title); refreshUi(); TextListItem.ViewHolder viewHolder = getViewHolderAtPosition(0); assertThat(viewHolder.getTitle().getText(), is(equalTo(title))); }