title: Expression might evaluate to null but is returned by the method declared as @NotNull
body: <p>After creating a RecyclerView adapter a warning about my view holder is returned. I've read <a href="https://stackoverflow.com/questions/30381447/could-this-call-to-getstring-actually-return-null">this question</a> and understand it a bit, but it's not clear as to what the <code>viewHolder</code> instance in <code>return viewHolder;</code> should be replaced with.</p>
  
  <blockquote>
    <p>Expression might evaluate to null but is returned by the method declared as @NotNull</p>
  </blockquote>
  
  <pre><code>public class MyRVAapter extends RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt; {
      private final static int TYPE_EXPANDABLE = 1, TYPE_NONEXPANDABLE = 2;
      private ArrayList callSMSFeed = new ArrayList();
      private Context context;
  
      public MyRVAapter(Context context){
          this.context = context;
      }
  
      public void setCallSMSFeed(List&lt;Object&gt; callSMSFeed){
          this.callSMSFeed = (ArrayList) callSMSFeed;
      }
  
    @Override
      public int getItemViewType(int position) {
          if (callSMSFeed.get(position) instanceof Phonecall) {
              return TYPE_EXPANDABLE;
          } else if (callSMSFeed.get(position) instanceof SMSmessage) {
              return TYPE_NONEXPANDABLE;
          }
          return -1;
      }
  
      @Override
      public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, final int position) {
          int viewType=holder.getItemViewType();
          switch (viewType){
              case TYPE_EXPANDABLE:
                  Phonecall call = (Phonecall) callSMSFeed.get(position);
                  ((CallViewHolder)holder).showCallDetails(call);
                  break;
              case TYPE_NONEXPANDABLE:
                  SMSmessage sms = (SMSmessage)callSMSFeed.get(position);
                  ((SMSViewHolder)holder).showSmsDetails(sms);
                  break;
          }
      }
  
      @Override
      public int getItemCount(){return callSMSFeed.size();}
  
      @NonNull
      @Override
      public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
  
  
          int layout;
  
          RecyclerView.ViewHolder viewHolder;
          switch (viewType){
              case TYPE_EXPANDABLE:
                  layout = R.layout.cardview_a;
                  View callsView = LayoutInflater
                          .from(parent.getContext())
                          .inflate(layout, parent, false);
                  viewHolder = new CallViewHolder(callsView);
                  break;
              case TYPE_NONEXPANDABLE:
                  layout = R.layout.cardview_b;
                  View smsView = LayoutInflater
                          .from(parent.getContext())
                          .inflate(layout, parent, false);
                  viewHolder = new SMSViewHolder(smsView);
                  break;
              default:
                  viewHolder = null;
                  break;
          }
          return viewHolder;
      }
  }
  </code></pre>