📌  相关文章
📜  检查可选是否为空 java 代码示例

📅  最后修改于: 2022-03-11 14:52:39.563000             🧑  作者: Mango

代码示例1
@Test
public void givenNull_whenCreatesNullable_thenCorrect() {
    String name = null;
    Optional opt = Optional.ofNullable(name);
    assertFalse(opt.isPresent());
}