code: public static long[] copy(long[] v, int mincap) {
      int words = ((mincap - 1) >>> LONG_LOG2_SIZE) + 1;
      if(v.length == words) {
        return Arrays.copyOf(v, v.length);
      }
      long[] ret = new long[words];
      System.arraycopy(v, 0, ret, 0, Math.min(v.length, words));
      return ret;
    }
docs: Copy a bitset.
  
  Note: Bits beyond mincap <em>may</em> be retained!
  
  @param v Array to copy
  @param mincap Target <em>minimum</em> capacity
  @return Copy with space for at least "capacity" bits