@@ -111,24 +111,17 @@ public void whenCreateImmutableList_thenCreated() {
111111 assertThat (immutable , contains ("John" , "Adam" , "Jane" , "Tom" ));
112112 }
113113
114+ // sets
115+
114116 @ Test
115- public void whenCalculateUnion_thenCorrect () {
117+ public void whenCalculateUnionOfSets_thenCorrect () {
116118 final Set <Character > first = ImmutableSet .of ('a' , 'b' , 'c' );
117119 final Set <Character > second = ImmutableSet .of ('b' , 'c' , 'd' );
118120
119121 final Set <Character > union = Sets .union (first , second );
120122 assertThat (union , containsInAnyOrder ('a' , 'b' , 'c' , 'd' ));
121123 }
122124
123- @ Test
124- public void whenCalculateIntersection_thenCorrect () {
125- final Set <Character > first = ImmutableSet .of ('a' , 'b' , 'c' );
126- final Set <Character > second = ImmutableSet .of ('b' , 'c' , 'd' );
127-
128- final Set <Character > intersection = Sets .intersection (first , second );
129- assertThat (intersection , containsInAnyOrder ('b' , 'c' ));
130- }
131-
132125 @ Test
133126 public void whenCalculateSetsProduct_thenCorrect () {
134127 final Set <Character > first = ImmutableSet .of ('a' , 'b' );
@@ -146,6 +139,15 @@ public final String apply(final List<Character> input) {
146139 assertThat (joined , containsInAnyOrder ("a c" , "a d" , "b c" , "b d" ));
147140 }
148141
142+ @ Test
143+ public void whenCalculatingSetIntersection_thenCorrect () {
144+ final Set <Character > first = ImmutableSet .of ('a' , 'b' , 'c' );
145+ final Set <Character > second = ImmutableSet .of ('b' , 'c' , 'd' );
146+
147+ final Set <Character > intersection = Sets .intersection (first , second );
148+ assertThat (intersection , containsInAnyOrder ('b' , 'c' ));
149+ }
150+
149151 @ Test
150152 public void whenCalculatePowerSet_thenCorrect () {
151153 final Set <Character > chars = ImmutableSet .of ('a' , 'b' );
0 commit comments