question: public static double [ ] concatAllDouble ( double [ ] ... arrays ) { int totalLength = 0 ; final int subArrayCount = arrays . length ; for ( int i = 0 ; i < subArrayCount ; ++ i ) { totalLength += arrays [ i ] . length ; } double [ ] result = Arrays . copyOf ( arrays [ 0 ] , totalLength ) ; int offset = arrays [ 0 ] . length ; for ( int i = 1 ; i < subArrayCount ; ++ i ) { System . arraycopy ( arrays [ i ] , 0 , result , offset , arrays [ i ] . length ) ; offset += arrays [ i ] . length ; } return result ; }
target:  Concatenates a list of double arrays into a single array.