From adaff1d253df97727ce0a892fc189baae765a91c Mon Sep 17 00:00:00 2001 From: catalin-burcea Date: Sat, 5 Oct 2019 19:13:09 +0300 Subject: [PATCH] Split or move guava-collections module --- guava-collections-map/README.md | 12 ++ guava-collections-map/pom.xml | 32 ++++++ .../ClassToInstanceMapUnitTest.java | 2 +- .../GuavaMapInitializeUnitTest.java | 2 +- .../guava/maps/GuavaMapsUnitTest.java | 103 +----------------- .../multimap}/GuavaMultiMapUnitTest.java | 2 +- .../rangemap}/GuavaRangeMapUnitTest.java | 2 +- guava-collections/.gitignore | 13 --- guava-collections/README.md | 6 +- guava-collections/pom.xml | 2 +- .../GuavaCollectionsExamplesUnitTest.java | 2 +- ...avaFilterTransformCollectionsUnitTest.java | 2 +- .../guava/joinsplit}/GuavaStringUnitTest.java | 2 +- .../guava/lists/GuavaListsUnitTest.java | 82 ++++++++++++++ .../GuavaOrderingExamplesUnitTest.java | 2 +- .../ordering}/GuavaOrderingUnitTest.java | 2 +- .../CollectionApachePartitionUnitTest.java | 2 +- .../CollectionGuavaPartitionUnitTest.java | 2 +- .../CollectionJavaPartitionUnitTest.java | 2 +- .../guava/queues}/EvictingQueueUnitTest.java | 2 +- .../queues}/MinMaxPriorityQueueUnitTest.java | 2 +- .../guava/table}/GuavaTableUnitTest.java | 2 +- .../hamcrest/HamcrestExamplesUnitTest.java | 2 +- .../src/test/resources/.gitignore | 13 --- guava/README.md | 1 - pom.xml | 2 + 26 files changed, 149 insertions(+), 149 deletions(-) create mode 100644 guava-collections-map/README.md create mode 100644 guava-collections-map/pom.xml rename {guava-collections/src/test/java/org/baeldung/guava => guava-collections-map/src/test/java/com/baeldung/guava/classtoinstancemap}/ClassToInstanceMapUnitTest.java (97%) rename {guava-collections/src/test/java/org/baeldung/guava/maps/initialize => guava-collections-map/src/test/java/com/baeldung/guava/initializemaps}/GuavaMapInitializeUnitTest.java (95%) rename guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java => guava-collections-map/src/test/java/com/baeldung/guava/maps/GuavaMapsUnitTest.java (51%) rename {guava-collections/src/test/java/org/baeldung/guava => guava-collections-map/src/test/java/com/baeldung/guava/multimap}/GuavaMultiMapUnitTest.java (97%) rename {guava-collections/src/test/java/org/baeldung/guava => guava-collections-map/src/test/java/com/baeldung/guava/rangemap}/GuavaRangeMapUnitTest.java (99%) delete mode 100644 guava-collections/.gitignore rename guava-collections/src/test/java/{org/baeldung/guava => com/baeldung/guava/collections}/GuavaCollectionsExamplesUnitTest.java (99%) rename guava-collections/src/test/java/{org/baeldung/guava => com/baeldung/guava/filtertransform}/GuavaFilterTransformCollectionsUnitTest.java (99%) rename guava-collections/src/test/java/{org/baeldung/guava => com/baeldung/guava/joinsplit}/GuavaStringUnitTest.java (99%) create mode 100644 guava-collections/src/test/java/com/baeldung/guava/lists/GuavaListsUnitTest.java rename guava-collections/src/test/java/{org/baeldung/guava => com/baeldung/guava/ordering}/GuavaOrderingExamplesUnitTest.java (99%) rename guava-collections/src/test/java/{org/baeldung/guava => com/baeldung/guava/ordering}/GuavaOrderingUnitTest.java (98%) rename guava-collections/src/test/java/{org/baeldung/java => com/baeldung/guava/partition}/CollectionApachePartitionUnitTest.java (97%) rename guava-collections/src/test/java/{org/baeldung/java => com/baeldung/guava/partition}/CollectionGuavaPartitionUnitTest.java (98%) rename guava-collections/src/test/java/{org/baeldung/java => com/baeldung/guava/partition}/CollectionJavaPartitionUnitTest.java (98%) rename guava-collections/src/test/java/{org/baeldung/guava => com/baeldung/guava/queues}/EvictingQueueUnitTest.java (95%) rename guava-collections/src/test/java/{org/baeldung/guava => com/baeldung/guava/queues}/MinMaxPriorityQueueUnitTest.java (97%) rename guava-collections/src/test/java/{org/baeldung/guava => com/baeldung/guava/table}/GuavaTableUnitTest.java (99%) rename guava-collections/src/test/java/{org => com}/baeldung/hamcrest/HamcrestExamplesUnitTest.java (99%) delete mode 100644 guava-collections/src/test/resources/.gitignore diff --git a/guava-collections-map/README.md b/guava-collections-map/README.md new file mode 100644 index 0000000000..b3ec5e2157 --- /dev/null +++ b/guava-collections-map/README.md @@ -0,0 +1,12 @@ +========= + +## Guava Collections Map examples + +This module contains articles about map collections in Guava + +### Relevant Articles: +- [Guava – Maps](https://www.baeldung.com/guava-maps) +- [Guide to Guava Multimap](https://www.baeldung.com/guava-multimap) +- [Guide to Guava RangeMap](https://www.baeldung.com/guava-rangemap) +- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) +- [Guide to Guava ClassToInstanceMap](https://www.baeldung.com/guava-class-to-instance-map) \ No newline at end of file diff --git a/guava-collections-map/pom.xml b/guava-collections-map/pom.xml new file mode 100644 index 0000000000..45bb6b8caa --- /dev/null +++ b/guava-collections-map/pom.xml @@ -0,0 +1,32 @@ + + 4.0.0 + com.baeldung.guava + guava-collections-map + 0.1.0-SNAPSHOT + guava-collections-map + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + + + + guava-collections-map + + + src/main/resources + true + + + + + + + + \ No newline at end of file diff --git a/guava-collections/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/classtoinstancemap/ClassToInstanceMapUnitTest.java similarity index 97% rename from guava-collections/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java rename to guava-collections-map/src/test/java/com/baeldung/guava/classtoinstancemap/ClassToInstanceMapUnitTest.java index 295672d7ad..b9807379eb 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java +++ b/guava-collections-map/src/test/java/com/baeldung/guava/classtoinstancemap/ClassToInstanceMapUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.classtoinstancemap; import com.google.common.collect.ClassToInstanceMap; import com.google.common.collect.ImmutableClassToInstanceMap; import com.google.common.collect.MutableClassToInstanceMap; diff --git a/guava-collections/src/test/java/org/baeldung/guava/maps/initialize/GuavaMapInitializeUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/initializemaps/GuavaMapInitializeUnitTest.java similarity index 95% rename from guava-collections/src/test/java/org/baeldung/guava/maps/initialize/GuavaMapInitializeUnitTest.java rename to guava-collections-map/src/test/java/com/baeldung/guava/initializemaps/GuavaMapInitializeUnitTest.java index 2414afb720..0866496ef5 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/maps/initialize/GuavaMapInitializeUnitTest.java +++ b/guava-collections-map/src/test/java/com/baeldung/guava/initializemaps/GuavaMapInitializeUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava.maps.initialize; +package com.baeldung.guava.initializemaps; import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.*; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/maps/GuavaMapsUnitTest.java similarity index 51% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java rename to guava-collections-map/src/test/java/com/baeldung/guava/maps/GuavaMapsUnitTest.java index ab38afa5c4..4108df8c96 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java +++ b/guava-collections-map/src/test/java/com/baeldung/guava/maps/GuavaMapsUnitTest.java @@ -1,115 +1,18 @@ -package org.baeldung.guava; +package com.baeldung.guava.maps; -import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; import java.util.List; import java.util.Map; -import java.util.Set; import org.junit.Test; import com.google.common.base.Function; -import com.google.common.base.Joiner; -import com.google.common.base.Predicates; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.BiMap; -import com.google.common.collect.ClassToInstanceMap; -import com.google.common.collect.ContiguousSet; -import com.google.common.collect.DiscreteDomain; -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.HashBiMap; -import com.google.common.collect.HashMultiset; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSortedMap; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Multimap; -import com.google.common.collect.Multimaps; -import com.google.common.collect.Multiset; -import com.google.common.collect.Multisets; -import com.google.common.collect.MutableClassToInstanceMap; -import com.google.common.collect.Ordering; -import com.google.common.collect.Range; -import com.google.common.collect.RangeSet; -import com.google.common.collect.Sets; -import com.google.common.collect.Table; -import com.google.common.collect.Tables; -import com.google.common.collect.TreeRangeSet; +import com.google.common.collect.*; -public class GuavaCollectionTypesUnitTest { - - @Test - public void whenCreateList_thenCreated() { - final List names = Lists.newArrayList("John", "Adam", "Jane"); - - names.add("Tom"); - assertEquals(4, names.size()); - - names.remove("Adam"); - assertThat(names, contains("John", "Jane", "Tom")); - } - - @Test - public void whenReverseList_thenReversed() { - final List names = Lists.newArrayList("John", "Adam", "Jane"); - - final List reversed = Lists.reverse(names); - assertThat(reversed, contains("Jane", "Adam", "John")); - } - - @Test - public void whenCreateCharacterListFromString_thenCreated() { - final List chars = Lists.charactersOf("John"); - - assertEquals(4, chars.size()); - assertThat(chars, contains('J', 'o', 'h', 'n')); - } - - @Test - public void whenPartitionList_thenPartitioned() { - final List names = Lists.newArrayList("John", "Jane", "Adam", "Tom", "Viki", "Tyler"); - final List> result = Lists.partition(names, 2); - - assertEquals(3, result.size()); - assertThat(result.get(0), contains("John", "Jane")); - assertThat(result.get(1), contains("Adam", "Tom")); - assertThat(result.get(2), contains("Viki", "Tyler")); - } - - @Test - public void whenRemoveDuplicatesFromList_thenRemoved() { - final List chars = Lists.newArrayList('h', 'e', 'l', 'l', 'o'); - assertEquals(5, chars.size()); - - final List result = ImmutableSet.copyOf(chars).asList(); - assertThat(result, contains('h', 'e', 'l', 'o')); - } - - @Test - public void whenRemoveNullFromList_thenRemoved() { - final List names = Lists.newArrayList("John", null, "Adam", null, "Jane"); - Iterables.removeIf(names, Predicates.isNull()); - - assertEquals(3, names.size()); - assertThat(names, contains("John", "Adam", "Jane")); - } - - @Test - public void whenCreateImmutableList_thenCreated() { - final List names = Lists.newArrayList("John", "Adam", "Jane"); - - names.add("Tom"); - assertEquals(4, names.size()); - - final ImmutableList immutable = ImmutableList.copyOf(names); - assertThat(immutable, contains("John", "Adam", "Jane", "Tom")); - } +public class GuavaMapsUnitTest { @Test public void whenCreateImmutableMap_thenCreated() { diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/multimap/GuavaMultiMapUnitTest.java similarity index 97% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java rename to guava-collections-map/src/test/java/com/baeldung/guava/multimap/GuavaMultiMapUnitTest.java index f51dcadefc..06e85e41e5 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java +++ b/guava-collections-map/src/test/java/com/baeldung/guava/multimap/GuavaMultiMapUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.multimap; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/rangemap/GuavaRangeMapUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java rename to guava-collections-map/src/test/java/com/baeldung/guava/rangemap/GuavaRangeMapUnitTest.java index c0c5efea23..f221a2dcf8 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java +++ b/guava-collections-map/src/test/java/com/baeldung/guava/rangemap/GuavaRangeMapUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.rangemap; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; diff --git a/guava-collections/.gitignore b/guava-collections/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/guava-collections/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/guava-collections/README.md b/guava-collections/README.md index 95397f0ff0..f2e5fa3577 100644 --- a/guava-collections/README.md +++ b/guava-collections/README.md @@ -6,15 +6,11 @@ ### Relevant Articles: - [Guava Collections Cookbook](https://www.baeldung.com/guava-collections) - [Guava Ordering Cookbook](https://www.baeldung.com/guava-order) +- [Guide to Guava’s Ordering](https://www.baeldung.com/guava-ordering) - [Hamcrest Collections Cookbook](https://www.baeldung.com/hamcrest-collections-arrays) - [Partition a List in Java](https://www.baeldung.com/java-list-split) - [Filtering and Transforming Collections in Guava](https://www.baeldung.com/guava-filter-and-transform-a-collection) - [Guava – Join and Split Collections](https://www.baeldung.com/guava-joiner-and-splitter-tutorial) - [Guava – Lists](https://www.baeldung.com/guava-lists) -- [Guava – Maps](https://www.baeldung.com/guava-maps) -- [Guide to Guava Multimap](https://www.baeldung.com/guava-multimap) -- [Guide to Guava RangeMap](https://www.baeldung.com/guava-rangemap) - [Guide to Guava MinMaxPriorityQueue and EvictingQueue](https://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue) -- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) - [Guide to Guava Table](https://www.baeldung.com/guava-table) -- [Guide to Guava ClassToInstanceMap](https://www.baeldung.com/guava-class-to-instance-map) diff --git a/guava-collections/pom.xml b/guava-collections/pom.xml index ecda3c9595..8cdb086029 100644 --- a/guava-collections/pom.xml +++ b/guava-collections/pom.xml @@ -43,7 +43,7 @@ - guava + guava-collections src/main/resources diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/collections/GuavaCollectionsExamplesUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/collections/GuavaCollectionsExamplesUnitTest.java index 7b5cef6055..86e8dea21c 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/collections/GuavaCollectionsExamplesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.collections; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/filtertransform/GuavaFilterTransformCollectionsUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/filtertransform/GuavaFilterTransformCollectionsUnitTest.java index 8562193665..447149f002 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/filtertransform/GuavaFilterTransformCollectionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.filtertransform; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java index a08efd7c31..73c4c3291e 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.joinsplit; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsString; diff --git a/guava-collections/src/test/java/com/baeldung/guava/lists/GuavaListsUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/lists/GuavaListsUnitTest.java new file mode 100644 index 0000000000..2f414dcdb1 --- /dev/null +++ b/guava-collections/src/test/java/com/baeldung/guava/lists/GuavaListsUnitTest.java @@ -0,0 +1,82 @@ +package com.baeldung.guava.lists; + +import com.google.common.base.Predicates; +import com.google.common.collect.*; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.hamcrest.Matchers.contains; + +public class GuavaListsUnitTest { + + @Test + public void whenCreateList_thenCreated() { + final List names = Lists.newArrayList("John", "Adam", "Jane"); + + names.add("Tom"); + assertEquals(4, names.size()); + + names.remove("Adam"); + assertThat(names, contains("John", "Jane", "Tom")); + } + + @Test + public void whenReverseList_thenReversed() { + final List names = Lists.newArrayList("John", "Adam", "Jane"); + + final List reversed = Lists.reverse(names); + assertThat(reversed, contains("Jane", "Adam", "John")); + } + + @Test + public void whenCreateCharacterListFromString_thenCreated() { + final List chars = Lists.charactersOf("John"); + + assertEquals(4, chars.size()); + assertThat(chars, contains('J', 'o', 'h', 'n')); + } + + @Test + public void whenPartitionList_thenPartitioned() { + final List names = Lists.newArrayList("John", "Jane", "Adam", "Tom", "Viki", "Tyler"); + final List> result = Lists.partition(names, 2); + + assertEquals(3, result.size()); + assertThat(result.get(0), contains("John", "Jane")); + assertThat(result.get(1), contains("Adam", "Tom")); + assertThat(result.get(2), contains("Viki", "Tyler")); + } + + @Test + public void whenRemoveDuplicatesFromList_thenRemoved() { + final List chars = Lists.newArrayList('h', 'e', 'l', 'l', 'o'); + assertEquals(5, chars.size()); + + final List result = ImmutableSet.copyOf(chars).asList(); + assertThat(result, contains('h', 'e', 'l', 'o')); + } + + @Test + public void whenRemoveNullFromList_thenRemoved() { + final List names = Lists.newArrayList("John", null, "Adam", null, "Jane"); + Iterables.removeIf(names, Predicates.isNull()); + + assertEquals(3, names.size()); + assertThat(names, contains("John", "Adam", "Jane")); + } + + @Test + public void whenCreateImmutableList_thenCreated() { + final List names = Lists.newArrayList("John", "Adam", "Jane"); + + names.add("Tom"); + assertEquals(4, names.size()); + + final ImmutableList immutable = ImmutableList.copyOf(names); + assertThat(immutable, contains("John", "Adam", "Jane", "Tom")); + } + +} diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingExamplesUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingExamplesUnitTest.java index b8be06deb4..46ceccd7ba 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingExamplesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.ordering; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingUnitTest.java similarity index 98% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingUnitTest.java index dd250898fd..73d464bde5 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.ordering; import com.google.common.base.Function; import com.google.common.collect.Ordering; diff --git a/guava-collections/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionApachePartitionUnitTest.java similarity index 97% rename from guava-collections/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/partition/CollectionApachePartitionUnitTest.java index 1071d4a5fb..1cb566dd6b 100644 --- a/guava-collections/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionApachePartitionUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java; +package com.baeldung.guava.partition; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/guava-collections/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionGuavaPartitionUnitTest.java similarity index 98% rename from guava-collections/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/partition/CollectionGuavaPartitionUnitTest.java index c4ddb35da2..8eb259b490 100644 --- a/guava-collections/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionGuavaPartitionUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java; +package com.baeldung.guava.partition; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/guava-collections/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionJavaPartitionUnitTest.java similarity index 98% rename from guava-collections/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/partition/CollectionJavaPartitionUnitTest.java index 63583987ea..d62ca275c1 100644 --- a/guava-collections/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionJavaPartitionUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java; +package com.baeldung.guava.partition; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/guava-collections/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/queues/EvictingQueueUnitTest.java similarity index 95% rename from guava-collections/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/queues/EvictingQueueUnitTest.java index e4d29d2e92..b9abef8d1f 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/queues/EvictingQueueUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.queues; import com.google.common.collect.EvictingQueue; diff --git a/guava-collections/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/queues/MinMaxPriorityQueueUnitTest.java similarity index 97% rename from guava-collections/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/queues/MinMaxPriorityQueueUnitTest.java index 1c4df03c86..95446e0d44 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/queues/MinMaxPriorityQueueUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.queues; import com.google.common.collect.MinMaxPriorityQueue; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/table/GuavaTableUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/table/GuavaTableUnitTest.java index 28e132074e..e9a9560afd 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/table/GuavaTableUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.table; import static org.assertj.core.api.Assertions.*; import java.util.List; diff --git a/guava-collections/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java b/guava-collections/src/test/java/com/baeldung/hamcrest/HamcrestExamplesUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java rename to guava-collections/src/test/java/com/baeldung/hamcrest/HamcrestExamplesUnitTest.java index 82b6b8c87c..820f065957 100644 --- a/guava-collections/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/hamcrest/HamcrestExamplesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; diff --git a/guava-collections/src/test/resources/.gitignore b/guava-collections/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/guava-collections/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/guava/README.md b/guava/README.md index a9694daf0b..f4d84437cc 100644 --- a/guava/README.md +++ b/guava/README.md @@ -3,7 +3,6 @@ ### Relevant Articles: - [Guava Functional Cookbook](https://www.baeldung.com/guava-functions-predicates) -- [Guide to Guava’s Ordering](https://www.baeldung.com/guava-ordering) - [Guide to Guava’s PreConditions](https://www.baeldung.com/guava-preconditions) - [Introduction to Guava CacheLoader](https://www.baeldung.com/guava-cacheloader) - [Introduction to Guava Memoizer](https://www.baeldung.com/guava-memoizer) diff --git a/pom.xml b/pom.xml index d15e7f22ff..2349d3642f 100644 --- a/pom.xml +++ b/pom.xml @@ -459,6 +459,7 @@ guava guava-io guava-collections + guava-collections-map guava-collections-set guava-modules @@ -1204,6 +1205,7 @@ guava guava-io guava-collections + guava-collections-map guava-collections-set guava-modules