title: Java Record custom constructor
body: <p>I have a java record that takes in a list</p>
  <pre><code>public record Zoo(List&lt;Animal&gt; animals ) {
  
       public Zoo(Collection&lt;Animal&gt; animals) {
           this(new ArrayList&lt;&gt;(animals));
       }
  
       ...
  }
  </code></pre>
  <p>However, the animals are not in sorted order, and I want to create record where animals are sorted. Is this possible in Java record?</p>
  <p>In plain java class, I could have</p>
  <pre><code>public class Zoo {
     ...
     public Zoo(List&lt;Animal&gt; animals) {
       this.animals = animals.sort(someComparator);
     } 
  
  }
  </code></pre>