#10 effective java: item 7

This commit is contained in:
haerong22
2022-05-31 01:43:52 +09:00
parent 635828eb4a
commit 0310ae6b3c
9 changed files with 150 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
package com.example.effectivejava.chapter01.item07.optional;
import org.junit.jupiter.api.Test;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.*;
class ChannelTest {
@Test
void npe() {
Channel channel = new Channel();
Optional<MemberShip> optional = channel.defaultMemberShip();
optional.ifPresent(MemberShip::hello);
}
}