Your IDE will tell you what is wrong; try hovering over the red lines. At the end of your stream code you still have a Stream<PickOrderLine>, just minus the items that were rejected by your filter. You still need to get the PickOrderLine object you want from the stream, and then use it to get a Product object to return.
Matthias Utrata wrote:Is that the correct way? I tried to add a return on the start, because there is a return statement in the if statement, though when I add the return at the start. The whole stream has red waves. Is there a way to use the return with the stream?
Wildfly 21 release notes wrote:Please note that WildFly runs on Java 11 and later in classpath mode.