code: public static void checkForValidSubTupleIndices(
          int parentSize, int fromIndex, int toIndex)
      {
          if (fromIndex < 0)
          {
              throw new IllegalArgumentException(
                  "Start index is negative: "+fromIndex);
          }
          if (toIndex > parentSize)
          {
              throw new IllegalArgumentException(
                  "End index is "+toIndex+", parent size is "+parentSize);
          }
          if (fromIndex > toIndex)
          {
              throw new IllegalArgumentException(
                  "Start index is "+fromIndex+", end index is "+toIndex);
          }
      }
docs: Checks whether the given indices are valid indices for a sub-tuple
  of a parent tuple with the given size, and throws an
  <code>IllegalArgumentException</code> if not.
  
  @param parentSize The size of the parent
  @param fromIndex The start index of the sub-tuple, inclusive
  @param toIndex The end index of the sub-tuple, exclusive
  @throws IllegalArgumentException If the given indices are invalid.
  This is the case when <code>fromIndex &lt; 0</code>,
  <code>fromIndex &gt; toIndex</code>, or
  <code>toIndex &gt; parentSize</code>,