Returns a new array that contains the concatenated contents of two arrays. @param first the first array of elements to concatenate @param second the second array of elements to concatenate @param type the component type of the returned array
(T[] first, T[] second, Class<T> type)
| 72 | */ |
| 73 | |
| 74 | @GwtIncompatible // Array.newInstance(Class, int) |
| 75 | public static <T> T[] concat(T[] first, T[] second, Class<T> type) { |
| 76 | T[] result = newArray(type, first.length + second.length); |
| 77 | System.arraycopy(first, 0, result, 0, first.length); |
| 78 | System.arraycopy(second, 0, result, first.length, second.length); |
| 79 | return result; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Returns a new array that prepends {@code element} to {@code array}. |
no test coverage detected