question: public static int [ ] expand ( int [ ] field , int newSize , boolean keepData ) { if ( field == null || field . length < newSize ) { int [ ] newArray = new int [ newSize ] ; if ( keepData && field != null ) { System . arraycopy ( field , 0 , newArray , 0 , field . length ) ; } return newArray ; } return field ; }
target:  This method will return a new allocated array of size newSize if newSize is greater than field.length. It will return the same array otherwise Only if keepData is set to true, the data of the array will be copied to the new allocated array