code: public void set(int[] initial) {
          resizeLock.lock();
          try {
              if (initial.length != length) {
                  throw new IllegalArgumentException("Array length mismatch, expected " + length + ", got " + initial.length);
              }
              int unique = AtomicShortIntArray.getUnique(initial);
              int allowedPalette = AtomicShortIntPaletteBackingArray.getAllowedPalette(length);
              if (unique == 1) {
                  store.set(new AtomicShortIntUniformBackingArray(length, initial[0]));
              } else if (unique > allowedPalette) {
                  store.set(new AtomicShortIntDirectBackingArray(length, initial));
              } else {
                  store.set(new AtomicShortIntPaletteBackingArray(length, unique, initial));
              }
          } finally {
              resizeLock.unlock();
          }
      }
docs: Sets the array equal to the given array.  The array should be the same length as this array
  
  @param initial the array containing the new values