public boolean positionExists(int position){
  int size=getItemCount() - 1;
  return position <= size;
}

public boolean positionExists ( int position ) { int size = getItemCount ( ) - 1 ; return position <= size ; }
checks if a position is valid in the list
