public ValuesArray invert(Combine com) {
   final int size = size();
   final ValuesArray res = new ValuesArray(this);
   for (int i = 0; i < size; i++) {
     res.set(i, com.negate(get(i)));
   }
   return res;
 }
  public ValuesArray combine(ValuesArray other, Combine com) {
    final int size = size();

    if (size != other.size()) {
      throw new ArrayIndexOutOfBoundsException(
          "Value arrays must be of the same size to be combined.\n" + this + "\n" + other);
    }

    ValuesArray res = new ValuesArray(this);
    for (int i = 0; i < size; i++) {
      res.set(i, com.eval(get(i), other.get(i)));
    }

    return res;
  }