question: private void writeObject ( java . io . ObjectOutputStream s ) throws java . io . IOException { lock . lock ( ) ; try { q = new PriorityQueue < E > ( Math . max ( size , 1 ) , comparator ) ; q . addAll ( this ) ; s . defaultWriteObject ( ) ; } finally { q = null ; lock . unlock ( ) ; } }
target:  Saves this queue to a stream (that is, serializes it). For compatibility with previous version of this class, elements are first copied to a java.util.PriorityQueue, which is then serialized.