public int size(){
  final ReentrantLock lock=this.lock;
  lock.lock();
  try {
    return count;
  }
  finally {
    lock.unlock();
  }
}

public int size ( ) { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { return count ; } finally { lock . unlock ( ) ; } }
returns the number of elements in this deque .
