📅  最后修改于: 2022-03-11 14:52:10.503000             🧑  作者: Mango
代码示例1
public static List toList(Optional opt) {
return opt
.map(Collections::singletonList)
.orElseGet(Collections::emptyList);
}