FoodViewHolder extends DataViewHolder<Food> { @Override public void populate(Food food) { name.setText(food.getName()); price.setText(itemView.getContext().getString(R.string.resto_extra_food_price, food.getPrice())); } FoodViewHolder(View itemView); @Override void populate(Food food);  }
@Test public void populate() { View view = inflate(R.layout.item_resto_fooditem); Food food = generate(Food.class); FoodViewHolder viewHolder = new FoodViewHolder(view); viewHolder.populate(food); assertTextIs(food.getName(), view.findViewById(R.id.food_item_name)); assertNotEmpty(view.findViewById(R.id.food_item_price)); }