question: protected static int [ ] insert ( int [ ] old , int oldSize , int pos , int x ) { int [ ] result ; if ( old != null && old . length > oldSize ) { result = old ; } else { result = new int [ oldSize + 1 + COPY_THRESHOLD ] ; if ( pos > 0 && old != null ) { System . arraycopy ( old , 0 , result , 0 , pos ) ; } } if ( old != null && oldSize - pos > 0 ) { System . arraycopy ( old , pos , result , pos + 1 , oldSize - pos ) ; } result [ pos ] = x ; return result ; }
target:  Insert a value in an array. A new array is created if required.