I have the following method:
public boolean isMsgOk(String msg) {...}
I want to call this method here:
public String[] returnOkMessages(String... msgs) {
return Arrays
.asList(messagessgs)
.stream(message->isMsgOk(message))
.anyMatch() ???;
}
I want to return a List
of String
s for which the isMsgOk
method returns true
.
How can I collect them?