From 477a9b90e1e71c12cebe0a741c47cd50c161ca57 Mon Sep 17 00:00:00 2001 From: eugenp Date: Tue, 4 Nov 2014 13:02:20 +0200 Subject: [PATCH] cleanup work in guava tests --- .../guava/GuavaCollectionTypesTest.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java b/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java index e0b2c50aa3..21ba483962 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'); @@ -146,6 +139,15 @@ public class GuavaCollectionTypesTest { assertThat(joined, containsInAnyOrder("a c", "a d", "b c", "b d")); } + @Test + 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 whenCalculatePowerSet_thenCorrect() { final Set chars = ImmutableSet.of('a', 'b');