diff --git a/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java b/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java index e0b2c50aa3..26d3fa90ca 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java +++ b/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java @@ -111,8 +111,10 @@ public class GuavaCollectionTypesTest { assertThat(immutable, contains("John", "Adam", "Jane", "Tom")); } + // sets + @Test - public void whenCalculateUnion_thenCorrect() { + public void whenCalculateUnionOfSets_thenCorrect() { final Set first = ImmutableSet.of('a', 'b', 'c'); final Set second = ImmutableSet.of('b', 'c', 'd'); @@ -120,15 +122,6 @@ public class GuavaCollectionTypesTest { assertThat(union, containsInAnyOrder('a', 'b', 'c', 'd')); } - @Test - public void whenCalculateIntersection_thenCorrect() { - final Set first = ImmutableSet.of('a', 'b', 'c'); - final Set second = ImmutableSet.of('b', 'c', 'd'); - - final Set intersection = Sets.intersection(first, second); - assertThat(intersection, containsInAnyOrder('b', 'c')); - } - @Test public void whenCalculateSetsProduct_thenCorrect() { final Set first = ImmutableSet.of('a', 'b'); @@ -147,7 +140,16 @@ public class GuavaCollectionTypesTest { } @Test - public void whenCalculatePowerSet_thenCorrect() { + public void whenCalculatingSetIntersection_thenCorrect() { + final Set first = ImmutableSet.of('a', 'b', 'c'); + final Set second = ImmutableSet.of('b', 'c', 'd'); + + final Set intersection = Sets.intersection(first, second); + assertThat(intersection, containsInAnyOrder('b', 'c')); + } + + @Test + public void whenCalculatingPowerSet_thenCorrect() { final Set chars = ImmutableSet.of('a', 'b'); final Set> result = Sets.powerSet(chars);