Added merging of arrays in Java