question: private double [ ] extend ( double [ ] array , double value ) { double [ ] result = null ; if ( array == null ) { result = new double [ 1 ] ; } else { result = Arrays . copyOf ( array , array . length + 1 ) ; } result [ result . length - 1 ] = value ; return result ; }
target:  Extends the given array with a new element appended to the end.