title: RecyclerView onClick geting error on filter adapter
body: <p>I have Filterable and clickable <code>RecyclerView</code>. But i getting eror when I filter this adapter</p>
  
  <p><strong>Before Filter:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/LdpKT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LdpKT.png" alt="Before Filter"></a></p>
  
  <p><strong>After Filter:</strong></p>
  
  <p>Still show item on position 3</p>
  
  <p><a href="https://i.stack.imgur.com/qEP1H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qEP1H.png" alt="After Filter"></a></p>
  
  <p><strong>My Adapter:</strong></p>
  
  <pre><code>public class PasalBabAdapter extends RecyclerView.Adapter&lt;PasalBabVH&gt; {
  
      private List&lt;PasalBabModel&gt; mPasalBabModel;
      private MyItemClickListener mItemClickListener;
      private MyItemLongClickListener mItemLongClickListener;
  
      public PasalBabAdapter(List&lt;PasalBabModel&gt; mPasalBabModel) {
          this.mPasalBabModel = mPasalBabModel;
      }
  
      @Override
      public void onBindViewHolder(PasalBabVH holder, int position) {
          PasalBabModel bean = mPasalBabModel.get(position);
          holder.p_TextView.setText(bean.pasalbab_p);
          holder.b_TextView.setText(bean.pasalbab_b);
      }
  
      public PasalBabVH onCreateViewHolder(ViewGroup parent, int viewType) {
          View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.pasalbab_row, parent, false);
          PasalBabVH vh = new PasalBabVH(itemView, mItemClickListener, mItemLongClickListener);
          return vh;
      }
  
  
      public void setFilter(List&lt;PasalBabModel&gt; PasalBabModels) {
          mPasalBabModel = new ArrayList&lt;&gt;();
          mPasalBabModel.addAll(PasalBabModels);
          notifyDataSetChanged();
      }
  
      @Override
      public int getItemCount() {
          return mPasalBabModel.size();
      }
  
      public void animateTo(List&lt;PasalBabModel&gt; models) {
          applyAndAnimateRemovals(models);
          applyAndAnimateAdditions(models);
          applyAndAnimateMovedItems(models);
      }
  
      private void applyAndAnimateRemovals(List&lt;PasalBabModel&gt; newModels) {
          for (int i = mPasalBabModel.size() - 1; i &gt;= 0; i--) {
              final PasalBabModel model = mPasalBabModel.get(i);
              if (!newModels.contains(model)) {
                  removeItem(i);
              }
          }
      }
  
      private void applyAndAnimateAdditions(List&lt;PasalBabModel&gt; newModels) {
          for (int i = 0, count = newModels.size(); i &lt; count; i++) {
              final PasalBabModel model = newModels.get(i);
              if (!mPasalBabModel.contains(model)) {
                  addItem(i, model);
              }
          }
      }
  
      private void applyAndAnimateMovedItems(List&lt;PasalBabModel&gt; newModels) {
          for (int toPosition = newModels.size() - 1; toPosition &gt;= 0; toPosition--) {
              final PasalBabModel model = newModels.get(toPosition);
              final int fromPosition = mPasalBabModel.indexOf(model);
              if (fromPosition &gt;= 0 &amp;&amp; fromPosition != toPosition) {
                  moveItem(fromPosition, toPosition);
              }
          }
      }
  
      public PasalBabModel removeItem(int position) {
          final PasalBabModel model = mPasalBabModel.remove(position);
          notifyItemRemoved(position);
          return model;
      }
  
      public void addItem(int position, PasalBabModel model) {
          mPasalBabModel.add(position, model);
          notifyItemInserted(position);
      }
  
      public void moveItem(int fromPosition, int toPosition) {
          final PasalBabModel model = mPasalBabModel.remove(fromPosition);
          mPasalBabModel.add(toPosition, model);
          notifyItemMoved(fromPosition, toPosition);
      }
  
      /**
       * ÉèÖÃItemµã»÷¼àÌý
       * @param listener
       */
  
      public void setOnItemClickListener(MyItemClickListener listener) {
          this.mItemClickListener = listener;
      }
  
      public void setOnItemLongClickListener(MyItemLongClickListener listener) {
          this.mItemLongClickListener = listener;
      }
  
  }
  </code></pre>
  
  <p><strong>My Fragment:</strong></p>
  
  <pre><code>public class Pasal_Bab extends Fragment implements SearchView.OnQueryTextListener {
  
      private RecyclerViewEmptySupport rv;
      private CoordinatorLayout mRelativeLayout;
      private List&lt;PasalBabModel&gt; mPBH;
      private PasalBabAdapter adapter;
      private FloatingActionButton fab;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
          View view = inflater.inflate(R.layout.activity_pasal, container, false);
          mRelativeLayout = (CoordinatorLayout) view.findViewById(R.id
                  .coordinator);
  
          rv = (RecyclerViewEmptySupport) view.findViewById(R.id.rv_pasal);
          LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
          rv.setLayoutManager(layoutManager);
          rv.setEmptyView(view.findViewById(R.id.empty));
          rv.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
          return view;
      }
  
      @Override
      public void onViewCreated(View view, Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
  
          setHasOptionsMenu(true);
  
          String[] locales = Locale.getISOCountries();
          mPBH = new ArrayList&lt;&gt;();
  
          for (String countryCode : locales) {
              Locale obj = new Locale("Pasalxyz", countryCode);
              mPBH.add(new PasalBabModel(obj.getDisplayCountry(), obj.getISO3Country()));
          }
  
          adapter = new PasalBabAdapter(mPBH);
          rv.setAdapter(adapter);
          adapter.setOnItemClickListener(new MyItemClickListener() {
              @Override
              public void onItemClick(View view, int postion) {
                  PasalBabModel bean = mPBH.get(postion);
                  if (bean != null) {
                      Toast.makeText(getActivity(), bean.getpasalbab_p(), Toast.LENGTH_SHORT).show();
                  }
              }
          });
          adapter.setOnItemLongClickListener(new MyItemLongClickListener() {
              @Override
              public void onItemLongClick(View view, int postion) {
                  PasalBabModel bean = mPBH.get(postion);
                  if (bean != null) {
                      Toast.makeText(getActivity(), bean.getpasalbab_p() + " Termasuk dalam " + bean.getpasalbab_b(), Toast.LENGTH_SHORT).show();
  
                  }
              }
          });
      }
  
  
      @Override
      public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
          inflater.inflate(R.menu.menu_main, menu);
  
          final MenuItem item = menu.findItem(R.id.action_search);
          final SearchView searchView = (SearchView) MenuItemCompat.getActionView(item);
          searchView.setOnQueryTextListener(this);
  
          MenuItemCompat.setOnActionExpandListener(item,
                  new MenuItemCompat.OnActionExpandListener() {
                      @Override
                      public boolean onMenuItemActionCollapse(MenuItem item) {
                          // Do something when collapsed
                          adapter.setFilter(mPBH);
                          return true; // Return true to collapse action view
                      }
  
                      @Override
                      public boolean onMenuItemActionExpand(MenuItem item) {
                          // Do something when expanded
                          return true; // Return true to expand action view
                      }
                  });
      }
  
      @Override
      public boolean onQueryTextSubmit(String query) {
          return false;
      }
  
      @Override
      public boolean onQueryTextChange(String newText) {
          final List&lt;PasalBabModel&gt; filteredModelList = filter(mPBH, newText);
          adapter.setFilter(filteredModelList);
          return false;
      }
  
      private List&lt;PasalBabModel&gt; filter(List&lt;PasalBabModel&gt; models, String query) {
          query = query.toLowerCase();
  
          final List&lt;PasalBabModel&gt; filteredModelList = new ArrayList&lt;&gt;();
          for (PasalBabModel model : models) {
              final String text = model.getpasalbab_p().toLowerCase();
              if (text.contains(query)) {
                  filteredModelList.add(model);
              }
          }
          return filteredModelList;
      }
  }
  </code></pre>
  
  <p>Please help me to fix this.</p>