code: public static IntegerVector add(IntegerVector vector1,
                                      IntegerVector vector2) {
          if (vector2.length() != vector1.length())
              throw new IllegalArgumentException(
                      "Vectors of different sizes cannot be added");
          // If vector is a sparse vector, simply get the non zero values and
          // add them to this instance.
          if (vector2 instanceof SparseVector) 
              addSparseValues(vector1, vector2);
          else if (vector2 instanceof TernaryVector)
              addTernaryValues(vector1, (TernaryVector)vector2);
          else {
              // Otherwise, inspect all values of vector, and only add the non
              // zero values.
              int length = vector2.length();
              for (int i = 0; i < length; ++i) {
                  int value = vector2.get(i);
                  // In the case that vector1 is sparse, only add non zero values.
                  if (value != 0d)
                      vector1.add(i, value);
              }
          }
          return vector1;
      }
docs: Adds the second {@code IntegerVector} to the first {@code IntegerVector}
  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}.