<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    On 14/12/2023 10:55, Viktor Klang wrote:<br>
    <blockquote type="cite" cite="mid:MW4PR10MB5774BD82000BCC031D7B8520FF8CA@MW4PR10MB5774.namprd10.prod.outlook.com">
      
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">I presume that the precondition to have
          the original collection be pre-ordered according to the
          supplied Comparator can be verified by checking before adding
          each element in the collection to the PQ that it compareTo
          equal-or-greater to the previous one?<br>
        </span></div>
      <br>
    </blockquote>
    It's not a precondition. If a PQ is created from an existing
    collection, or is deserialized (shudder!), then it has to copy and
    re-sort using the Comparator.<br>
    <br>
    -Alan<br>
  </body>
</html>