您可以使用两个,
flatMap然后使用a,
filter然后可以选择第一个,或者如果没有结果返回
null:
C c1 = listOfAObjects.stream() .flatMap(a -> a.getList().stream()) .flatMap(b -> b.getPr().stream()) .filter(c -> c.getName().equalsIgnoreCase(name)) .findFirst() .orElse(null);

您可以使用两个,
flatMap然后使用a,
filter然后可以选择第一个,或者如果没有结果返回
null:
C c1 = listOfAObjects.stream() .flatMap(a -> a.getList().stream()) .flatMap(b -> b.getPr().stream()) .filter(c -> c.getName().equalsIgnoreCase(name)) .findFirst() .orElse(null);