Skip to content

Commit be107e7

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents fa90697 + a05e2fd commit be107e7

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

‎guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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');
@@ -147,7 +140,16 @@ public final String apply(final List<Character> input) {
147140
}
148141

149142
@Test
150-
public void whenCalculatePowerSet_thenCorrect() {
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+
151+
@Test
152+
public void whenCalculatingPowerSet_thenCorrect() {
151153
final Set<Character> chars = ImmutableSet.of('a', 'b');
152154
final Set<Set<Character>> result = Sets.powerSet(chars);
153155

0 commit comments

Comments
 (0)