private void applyAndAnimateRemovals(List<T> from,List<T> newItems){
  hashItems=new HashSet<>(newItems);
  int out=0;
  for (int i=from.size() - 1; i >= 0; i--) {
    if (mFilterAsyncTask != null && mFilterAsyncTask.isCancelled())     return;
    final T item=from.get(i);
    if (!hashItems.contains(item) && (!isHeader(item) || (isHeader(item) && headersShown))) {
      from.remove(i);
      notifications.add(new Notification(i,Notification.REMOVE));
      out++;
    }
 else     if (notifyChangeOfUnfilteredItems) {
      from.set(i,item);
      notifications.add(new Notification(i,Notification.CHANGE));
    }
  }
  hashItems=null;
  if (DEBUG)   Log.v(TAG,"calculateRemovals total out=" + out);
}

private void applyAndAnimateRemovals ( List < T > from , List < T > newItems ) { hashItems = new HashSet < > ( newItems ) ; int out = 0 ; for ( int i = from . size ( ) - 1 ; i >= 0 ; i -- ) { if ( mFilterAsyncTask != null && mFilterAsyncTask . isCancelled ( ) ) return ; final T item = from . get ( i ) ; if ( ! hashItems . contains ( item ) && ( ! isHeader ( item ) || ( isHeader ( item ) && headersShown ) ) ) { from . remove ( i ) ; notifications . add ( new Notification ( i , Notification . REMOVE ) ) ; out ++ ; } else if ( notifyChangeOfUnfilteredItems ) { from . set ( i , item ) ; notifications . add ( new Notification ( i , Notification . CHANGE ) ) ; } } hashItems = null ; if ( DEBUG ) Log . v ( TAG , "calculateRemovals total out=" + out ) ; }
find out all removed items and animate them , also update existent positions with newitems .
