From cb083e23c87b815fc8346147fc1ead90c269c412 Mon Sep 17 00:00:00 2001 From: eugenp Date: Mon, 21 Dec 2015 11:37:37 +0200 Subject: [PATCH] new set test --- .../org/baeldung/guava/GuavaCollectionTypesTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java b/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java index 26d3fa90ca..2eb5141f8d 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java +++ b/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesTest.java @@ -148,6 +148,15 @@ public class GuavaCollectionTypesTest { assertThat(intersection, containsInAnyOrder('b', 'c')); } + @Test + public void whenCalculatingSetSymetricDifference_thenCorrect() { + final Set first = ImmutableSet.of('a', 'b', 'c'); + final Set second = ImmutableSet.of('b', 'c', 'd'); + + final Set intersection = Sets.symmetricDifference(first, second); + assertThat(intersection, containsInAnyOrder('a', 'd')); + } + @Test public void whenCalculatingPowerSet_thenCorrect() { final Set chars = ImmutableSet.of('a', 'b');