code: public static <T extends Object> T[] splice (T[] values, int offset, int length)
      {
          // make sure we've something to work with
          if (values == null) {
              throw new IllegalArgumentException("Can't splice a null array.");
  
          } else if (length == 0) {
              // we're not splicing anything!
              return values;
          }
  
          // require that the entire range to remove be within the array bounds
          int size = values.length;
          int tstart = offset + length;
          if (offset < 0 || tstart > size) {
              throw new ArrayIndexOutOfBoundsException(
                  "Splice range out of bounds [offset=" + offset +
                  ", length=" + length + ", size=" + size + "].");
          }
  
          // create a new array and populate it with the spliced-in values
          @SuppressWarnings("unchecked")
          T[] nvalues = (T[])Array.newInstance(values.getClass().getComponentType(), size - length);
          System.arraycopy(values, 0, nvalues, 0, offset);
          System.arraycopy(values, tstart, nvalues, offset, size - tstart);
          return nvalues;
      }
docs: Creates and returns a new array sized to fit and populated with the
  concatenated subset of values from indexes <code>0</code> to
  <code>offset - 1</code>, and <code>offset + length</code> to
  <code>values.length</code> (inclusive) in the supplied array. The
  type of the array is preserved.
  
  @param values the array of values to splice.
  @param offset the index within the <code>values</code> array at
  which the first element will be removed.  This must be a valid
  index within the <code>values</code> array.
  @param length the number of elements to be removed.  Note that
  <code>offset + length</code> must be a valid index within the
  <code>values</code> array.