The following code works fine:
以下代码运行良好:
Stream.of("key1", "key2")
.map(key -> {
SomeObject foo = service.find(key);
if (foo == null) {
throw new RuntimeException("No entity found with key: " + key);
}
return foo;
})
// ...
St