code: public static MutableIntTuple clamp(
          IntTuple t, int min, int max, MutableIntTuple result)
      {
          result = validate(t, result);
          for (int i=0; i<result.getSize(); i++)
          {
              int v = t.get(i);
              int r = Math.min(max, Math.max(min, v));
              result.set(i, r);
          }
          return result;
      }
docs: Clamp the elements of the given tuple to be in the specified range,
  and write the result into the given result tuple.
  
  @param t The input tuple
  @param min The minimum value
  @param max The maximum value
  @param result The result tuple
  @return The result tuple
  @throws IllegalArgumentException If the given tuples do not
  have the same {@link Tuple#getSize() size}