public void add(@NonNull T item){
synchronized (lock) {
    if (items == null) {
      items=new ArrayList<>();
    }
    items.add(item);
  }
  if (notifyOnChange) {
    notifyItemInserted(items.size());
  }
}

public void add ( @ NonNull T item ) { synchronized ( lock ) { if ( items == null ) { items = new ArrayList < > ( ) ; } items . add ( item ) ; } if ( notifyOnChange ) { notifyItemInserted ( items . size ( ) ) ; } }
adds the specified item to the end of the list
