code: public static Vector add(Vector vector1, Vector vector2) {
          if (vector2.length() != vector1.length())
              throw new IllegalArgumentException(
                      "Vectors of different sizes cannot be added");
          if (vector2 instanceof IntegerVector &&
              vector1 instanceof DoubleVector)
              return add(vector1, Vectors.asDouble(vector2));
          if (vector2 instanceof SparseVector)
              addSparseValues(vector1, vector2);
          else {
              int length = vector2.length();
              for (int i = 0; i < length; ++i) {
                  double value = vector2.getValue(i).doubleValue() +
                                 vector1.getValue(i).doubleValue();
                  vector1.set(i, value);
              }
          }
  
          return vector1;
      }
docs: Adds the second {@code Vector} to the first {@code Vector} and returns
  the result.
  
  @param vector1 The destination vector to be summed onto.
  @param vector2 The source vector to sum from.
  @return The summation of {code vector1} and {@code vector2}.