@@ -14,19 +14,14 @@ public class Java9SetFactoryMethodTest {
1414
1515 @ Test
1616 public void testImmutableSetJava9 () {
17-
1817 Set <String > japanNoodles = Set .of ("Ramen" , "Yakisoba" , "Udon" , "Soba" , "Somen" );
1918 assertEquals (5 , japanNoodles .size ());
2019 }
2120
2221 @ Test
2322 public void testImmutableSetNotModified () {
24-
25-
2623 Set <String > japanNoodles = Set .of ("Ramen" , "Yakisoba" , "Udon" , "Soba" , "Somen" );
27-
2824 assertEquals (5 , japanNoodles .size ());
29-
3025 assertThrows (UnsupportedOperationException .class , () -> {
3126 // Add more element
3227 japanNoodles .add ("Negi" );
@@ -38,7 +33,6 @@ public void testImmutableSetNotModified() {
3833
3934 @ Test
4035 public void testImmutableSetNullAttempts () {
41-
4236 assertThrows (NullPointerException .class , () -> {
4337 Set <String > stringList = Set .of (null );
4438 });
@@ -47,7 +41,6 @@ public void testImmutableSetNullAttempts() {
4741
4842 @ Test
4943 public void testImmutableSetRejectDupplicates () {
50-
5144 assertThrows (IllegalArgumentException .class , () -> {
5245 Set <?> teaSet = Set .of ("Shincha" , "Aki Bancha" , "Hojicha" , "Hojicha" );
5346 });
@@ -81,7 +74,6 @@ public void testImmutableSetMutableElements() {
8174
8275 @ Test
8376 public void testImmutableSetSerializable () throws IOException {
84-
8577 Set <String > drinks = Set .of ("Gyokuro" , "Tamaryokucha" , "Kamairicha" );
8678 //serialize the list
8779 ObjectOutputStream oos = new ObjectOutputStream (System .out );
0 commit comments