code: public static IntegerVector subtract(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) 
              subtractSparseValues(vector1, vector2);
          else if (vector2 instanceof TernaryVector)
              subtractTernaryValues(vector1, (TernaryVector)vector2);
          else {
              // Otherwise, inspect all values of vector, and only add the non
              // zero values.
              for (int i = 0; i < vector2.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, -1 * value);
              }
          }
          return vector1;
      }
docs: Subtracts the second {@code IntegerVector} from the first {@code
  IntegerVector} and returns the result.
  
  @param vector1 The destination vector to be subtracted from.
  @param vector2 The source vector to subtract.
  @return The subtraction of {code vector2} from {@code vector1}.