code: private static Object[] concatenate(Object[] a, Object[] b) {
  
          int aLen = a.length;
          int bLen = b.length;
  
          Object[] newArray = new Object[aLen + bLen];
          System.arraycopy(a, 0, newArray, 0, aLen);
          System.arraycopy(b, 0, newArray, aLen, bLen);
  
          return newArray;
      }
docs: Source: https://stackoverflow.com/a/80503