code: public static IntegerVector copyOf(IntegerVector source) {
          IntegerVector result = null;
  
          if (source instanceof TernaryVector) {
              TernaryVector v = (TernaryVector) source;
              int[] pos = v.positiveDimensions();
              int[] neg = v.negativeDimensions();
              result = new TernaryVector(source.length(),
                                         Arrays.copyOf(pos, pos.length),
                                         Arrays.copyOf(neg, neg.length));
          } else if (source instanceof SparseVector) {
              result = new SparseHashIntegerVector(source.length());
              copyFromSparseVector(result, source);
          } else {
              result = new DenseIntVector(source.length());
              for (int i = 0; i < source.length(); ++i)
                  result.set(i, source.get(i));
          }
          return result;
      }
docs: Creates a copy of a given {@code IntegerVector} with the same type as the
  original.
  
  @param source The {@code Vector} to copy.
  
  @return A copy of {@code source} with the same type.