- result.map(Collections::singleton).orElse(Collections.emptySet()).stream()
- .filter(Objects::nonNull)
- .filter(flowCapableNode -> flowCapableNode.getTable() != null)
- .flatMap(flowCapableNode -> flowCapableNode.getTable().stream())
- .filter(Objects::nonNull)
- .filter(table -> table.getFlow() != null)
- .flatMap(table -> table.getFlow().stream())
- .filter(Objects::nonNull)
- .filter(flow -> flow.getId() != null)
- .forEach(flowConsumer);
+ result.ifPresent(flowCapableNode -> {
+ flowCapableNode.nonnullTable().stream()
+ .filter(Objects::nonNull)
+ .flatMap(table -> table.nonnullFlow().stream())
+ .filter(Objects::nonNull)
+ .filter(flow -> flow.getId() != null)
+ .forEach(flowConsumer);
+ });