Use the method headSet in combination with parallel streams. In your example, it looks as follows:
SortedSet<Integer> numbers = getNumbers();
numbers.headSet(100 + 1)
.parallelStream()
.filter(n -> n <= 100) // no longer required
.forEach(...);
First the code does a binary search with logarithmic complexity. Afterwards, all elements smaller than 100 + 1
are handled in parallel.
Edit: Unfortunately, neither TreeSet nor ConcurrentSkipListSet supports parallel execution on subsets. The above code will work, but it will always be executed sequentially. This can be checked using the following code. I see no reason, why this could not be implemented. I guess nobody thought it might be important.
SortedSet<Integer> numbers = ...;
System.out.printf("Full Set: %s\nPartial Set: %s\n",
numbers.spliterator().trySplit(),
numbers.headSet(1_000_000).spliterator().trySplit());