I\'m attempting to extend Java 8\'s Stream implementation.
I have this interface:
public interface StreamStuff extends Stream {
St
You are calling stream()
on the Arrays
class, which creates its own Stream
implementation without any connection to yours. You'd have to produce the Stream
yourself, or wrap a stream you obtained elsewhere, in order for something like this to work. Something like this:
int[] filtered = new StreamStuff(Arrays.stream(arr)).biggerThanFour().toArray();
However, in your case, why don't you just filter?
int[] filtered = Arrays.stream(arr).filter(i -> i > 4).toArray();