question: private List < Double > toList ( double [ ] x ) { List < Double > result = new ArrayList < Double > ( ) ; for ( int i = 0 ; i < x . length ; i ++ ) { result . add ( x [ i ] ) ; } return result ; }
target:  Converts a double array to a list.