title: How to test a recycler view adapter in Android Studio
body: <p>Can someone help me test this recycler view adapter? I wan't to make a local unit test, but doesn't really know how to begin?
  Following is my recyclerViewAdapter class:</p>
  
  <pre><code> public class RecyclerViewAdapter extends RecyclerView.Adapter&lt;RecyclerViewHolders&gt; {
      private List&lt;TasksTask&gt; task;
      protected Context context;
      public RecyclerViewAdapter(Context context, List&lt;TasksTask&gt; task) {
          this.task = task;
          this.context = context;
      }
      @Override
      public RecyclerViewHolders onCreateViewHolder(ViewGroup parent, int viewType) {
          RecyclerViewHolders viewHolder = null;
          View layoutView = LayoutInflater.from(parent.getContext()).inflate(R.layout.to_do_list, parent, false);
          viewHolder = new RecyclerViewHolders(layoutView, task);
          return viewHolder;
      }
      @Override
      public void onBindViewHolder(RecyclerViewHolders holder, int position) {
          holder.categoryTitle.setText(task.get(position).getTask());
  
      }
      @Override
      public int getItemCount() {
          return this.task.size();
      }}
  </code></pre>
  
  <p>And here is my recyclerViewHolder class:</p>
  
  <pre><code>public class RecyclerViewHolders extends RecyclerView.ViewHolder {
      private static final String TAG = RecyclerViewHolders.class.getSimpleName();
      public TextView categoryTitle;
      public ImageView deleteIcon;
      private List&lt;TasksTask&gt; taskObject;
  
  
      private FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
      private FirebaseUser firebaseUser = firebaseAuth.getCurrentUser();
      private DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();
  
  
      public RecyclerViewHolders(final View itemView, final List&lt;TasksTask&gt; taskObject) {
          super(itemView);
          this.taskObject = taskObject;
          categoryTitle = (TextView) itemView.findViewById(R.id.task_title);
          deleteIcon = (ImageView) itemView.findViewById(R.id.task_delete);
  
          deleteIcon.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  String taskTitle = taskObject.get(getAdapterPosition()).getTask();
                  mDatabase.child("Users").child(firebaseUser.getUid()).child("Tasks").child(taskTitle).removeValue();
              }
          });
      }
  }
  </code></pre>