<div dir="ltr">Added the methods deepCopyOf(U[] original, Class<? extends T[]> newType) and deepCopyOf(T[] original), that perform a deep copy of the structure of multidimensional arrays. Also, added a pre-calculation of the string builders capacity for toString() of primitive array types, based on the mold of BitSet.toString() method for pre-calculation of the initial capacity.<br><br>The deep copy is necessary for coping a multiarray that should be assigned to a field or returned by a getter method, to ensure that the data structure will not be modified externally of the class.<br><br>The pre-calculation of the string builders capacity is an optimization to reduce the times that builders needs to grow their capacity.<br><div><br></div><div>Link to the pull request: <a href="https://github.com/openjdk/jdk/pull/11815">https://github.com/openjdk/jdk/pull/11815</a><br></div></div>