How can I use stream to evaluate multiple service calls only if the previous call returned null? ie.
Stream.of(service1(), service2(), service3())
.filter(Objects::nonNull)
.findFirst()
.ifPresent(this::doSomething);
basically I don't want all three service calls to be invoked if they don't have to be, and I'm interested if there's a better way to do this without a bunch of
if(service1() != null)
...
else if(service2() != null)
...
else if(service3() != null)
...