code: public <T extends KTypeProcedure<? super KType>> T forEach(T procedure, int fromIndex, final int toIndex) {
      assert (fromIndex >= 0 && fromIndex <= size()) :
          "Index " + fromIndex + " out of bounds [" + 0 + ", " + size() + ").";
  
      assert (toIndex >= 0 && toIndex <= size()) :
          "Index " + toIndex + " out of bounds [" + 0 + ", " + size() + "].";
      
      assert fromIndex <= toIndex : "fromIndex must be <= toIndex: "
          + fromIndex + ", " + toIndex;
  
      final KType [] buffer = Intrinsics.<KType[]> cast(this.buffer);
      for (int i = fromIndex; i < toIndex; i++) {
          procedure.apply(buffer[i]);
      }
  
      return procedure;
    }
docs: Applies <code>procedure</code> to a slice of the list,
  <code>fromIndex</code>, inclusive, to <code>toIndex</code>, exclusive.