code: public <T extends KTypePredicate<? super KType>> T forEach(T predicate, 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++) {
        if (!predicate.apply(buffer[i]))
          break;
      }
      
      return predicate;
    }
docs: Applies <code>predicate</code> to a slice of the list,
  <code>fromIndex</code>, inclusive, to <code>toIndex</code>, exclusive, or
  until predicate returns <code>false</code>.