diff --git a/akka-streams/README.md b/akka-streams/README.md
index 7f2751422b..5f71991def 100644
--- a/akka-streams/README.md
+++ b/akka-streams/README.md
@@ -1,3 +1,3 @@
### Relevant articles
-- [Guide to Akka Streams](http://www.baeldung.com/akka-streams)
+- [Guide to Akka Streams](https://www.baeldung.com/akka-streams)
diff --git a/algorithms-genetic/README.md b/algorithms-genetic/README.md
index 39f8d59eee..124e9c09e5 100644
--- a/algorithms-genetic/README.md
+++ b/algorithms-genetic/README.md
@@ -1,6 +1,6 @@
## Relevant articles:
-- [Introduction to Jenetics Library](http://www.baeldung.com/jenetics)
-- [Ant Colony Optimization](http://www.baeldung.com/java-ant-colony-optimization)
+- [Introduction to Jenetics Library](https://www.baeldung.com/jenetics)
+- [Ant Colony Optimization](https://www.baeldung.com/java-ant-colony-optimization)
- [Design a Genetic Algorithm in Java](https://www.baeldung.com/java-genetic-algorithm)
- [The Traveling Salesman Problem in Java](https://www.baeldung.com/java-simulated-annealing-for-traveling-salesman)
diff --git a/algorithms-miscellaneous-2/README.md b/algorithms-miscellaneous-2/README.md
index 745b106963..76727a1d4f 100644
--- a/algorithms-miscellaneous-2/README.md
+++ b/algorithms-miscellaneous-2/README.md
@@ -1,10 +1,10 @@
## Relevant articles:
-- [Dijkstra Algorithm in Java](https://www.baeldung.com/java-dijkstra)
+- [Dijkstra Shortest Path Algorithm in Java](https://www.baeldung.com/java-dijkstra)
- [Introduction to Cobertura](https://www.baeldung.com/cobertura)
- [Test a Linked List for Cyclicity](https://www.baeldung.com/java-linked-list-cyclicity)
- [Introduction to JGraphT](https://www.baeldung.com/jgrapht)
- [A Maze Solver in Java](https://www.baeldung.com/java-solve-maze)
- [Create a Sudoku Solver in Java](https://www.baeldung.com/java-sudoku)
- [Displaying Money Amounts in Words](https://www.baeldung.com/java-money-into-words)
-- [A Collaborative Filtering Recommendation System in Java](https://www.baeldung.com/java-collaborative-filtering-recommendations)
\ No newline at end of file
+- [A Collaborative Filtering Recommendation System in Java](https://www.baeldung.com/java-collaborative-filtering-recommendations)
diff --git a/algorithms-miscellaneous-3/README.md b/algorithms-miscellaneous-3/README.md
index ce0fde0415..d2d73ec8a1 100644
--- a/algorithms-miscellaneous-3/README.md
+++ b/algorithms-miscellaneous-3/README.md
@@ -2,9 +2,10 @@
- [Java Two Pointer Technique](https://www.baeldung.com/java-two-pointer-technique)
- [Implementing Simple State Machines with Java Enums](https://www.baeldung.com/java-enum-simple-state-machine)
-- [Converting Between Roman and Arabic Numerals in Java](http://www.baeldung.com/java-convert-roman-arabic)
-- [Practical Java Examples of the Big O Notation](http://www.baeldung.com/java-algorithm-complexity)
+- [Converting Between Roman and Arabic Numerals in Java](https://www.baeldung.com/java-convert-roman-arabic)
+- [Practical Java Examples of the Big O Notation](https://www.baeldung.com/java-algorithm-complexity)
- [Checking If a List Is Sorted in Java](https://www.baeldung.com/java-check-if-list-sorted)
- [Checking if a Java Graph has a Cycle](https://www.baeldung.com/java-graph-has-a-cycle)
- [A Guide to the Folding Technique in Java](https://www.baeldung.com/folding-hashing-technique)
- [Creating a Triangle with for Loops in Java](https://www.baeldung.com/java-print-triangle)
+- [Efficient Word Frequency Calculator in Java](https://www.baeldung.com/java-word-frequency)
diff --git a/algorithms-miscellaneous-3/pom.xml b/algorithms-miscellaneous-3/pom.xml
index 5999d33c86..67923d37d7 100644
--- a/algorithms-miscellaneous-3/pom.xml
+++ b/algorithms-miscellaneous-3/pom.xml
@@ -54,6 +54,21 @@
1.1.0test
+
+ org.openjdk.jmh
+ jmh-core
+ ${jmh-core.version}
+
+
+ org.openjdk.jmh
+ jmh-generator-annprocess
+ ${jmh-generator.version}
+
+
+ org.openjdk.jmh
+ jmh-generator-bytecode
+ ${jmh-generator.version}
+
@@ -73,5 +88,7 @@
4.328.0-jre2.6.0
+ 1.19
+ 1.19
\ No newline at end of file
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterStatistics.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterStatistics.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterStatistics.java
rename to algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterStatistics.java
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUnitTest.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUnitTest.java
rename to algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUnitTest.java
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUtil.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUtil.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUtil.java
rename to algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUtil.java
diff --git a/algorithms-sorting/README.md b/algorithms-sorting/README.md
index 968d51aecf..903865046a 100644
--- a/algorithms-sorting/README.md
+++ b/algorithms-sorting/README.md
@@ -1,9 +1,10 @@
## Relevant articles:
-- [Bubble Sort in Java](http://www.baeldung.com/java-bubble-sort)
+- [Bubble Sort in Java](https://www.baeldung.com/java-bubble-sort)
- [Merge Sort in Java](https://www.baeldung.com/java-merge-sort)
- [Quicksort Algorithm Implementation in Java](https://www.baeldung.com/java-quicksort)
- [Insertion Sort in Java](https://www.baeldung.com/java-insertion-sort)
- [Heap Sort in Java](https://www.baeldung.com/java-heap-sort)
- [Shell Sort in Java](https://www.baeldung.com/java-shell-sort)
- [Counting Sort in Java](https://www.baeldung.com/java-counting-sort)
+- [Sorting Strings by Contained Numbers in Java](https://www.baeldung.com/java-sort-strings-contained-numbers)
diff --git a/animal-sniffer-mvn-plugin/README.md b/animal-sniffer-mvn-plugin/README.md
index 4c7c381da4..e292fe29ca 100644
--- a/animal-sniffer-mvn-plugin/README.md
+++ b/animal-sniffer-mvn-plugin/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-[Introduction to Animal Sniffer Maven Plugin](http://www.baeldung.com/maven-animal-sniffer)
+[Introduction to Animal Sniffer Maven Plugin](https://www.baeldung.com/maven-animal-sniffer)
diff --git a/annotations/readme.md b/annotations/readme.md
index 2b052803e6..dc40a7e116 100644
--- a/annotations/readme.md
+++ b/annotations/readme.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Java Annotation Processing and Creating a Builder](http://www.baeldung.com/java-annotation-processing-builder)
+- [Java Annotation Processing and Creating a Builder](https://www.baeldung.com/java-annotation-processing-builder)
diff --git a/antlr/README.md b/antlr/README.md
index 419d9ddfbb..b6dac4aa4b 100644
--- a/antlr/README.md
+++ b/antlr/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [Java with ANTLR](http://www.baeldung.com/java-antlr)
+- [Java with ANTLR](https://www.baeldung.com/java-antlr)
diff --git a/apache-avro/README.md b/apache-avro/README.md
index 32d84ecc76..45ae6e2b9b 100644
--- a/apache-avro/README.md
+++ b/apache-avro/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Guide to Apache Avro](http://www.baeldung.com/java-apache-avro)
+- [Guide to Apache Avro](https://www.baeldung.com/java-apache-avro)
diff --git a/apache-bval/README.md b/apache-bval/README.md
index 80ea149993..a9b3979828 100644
--- a/apache-bval/README.md
+++ b/apache-bval/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Intro to Apache BVal](http://www.baeldung.com/apache-bval)
+- [Intro to Apache BVal](https://www.baeldung.com/apache-bval)
diff --git a/apache-curator/README.md b/apache-curator/README.md
index 9bda573292..30336d7cdc 100644
--- a/apache-curator/README.md
+++ b/apache-curator/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [Introduction to Apache Curator](http://www.baeldung.com/apache-curator)
+- [Introduction to Apache Curator](https://www.baeldung.com/apache-curator)
diff --git a/apache-cxf/README.md b/apache-cxf/README.md
index d03999dce3..87413df8c9 100644
--- a/apache-cxf/README.md
+++ b/apache-cxf/README.md
@@ -1,6 +1,6 @@
## Relevant Articles:
-- [Introduction to Apache CXF Aegis Data Binding](http://www.baeldung.com/aegis-data-binding-in-apache-cxf)
-- [Apache CXF Support for RESTful Web Services](http://www.baeldung.com/apache-cxf-rest-api)
-- [A Guide to Apache CXF with Spring](http://www.baeldung.com/apache-cxf-with-spring)
-- [Introduction to Apache CXF](http://www.baeldung.com/introduction-to-apache-cxf)
+- [Introduction to Apache CXF Aegis Data Binding](https://www.baeldung.com/aegis-data-binding-in-apache-cxf)
+- [Apache CXF Support for RESTful Web Services](https://www.baeldung.com/apache-cxf-rest-api)
+- [A Guide to Apache CXF with Spring](https://www.baeldung.com/apache-cxf-with-spring)
+- [Introduction to Apache CXF](https://www.baeldung.com/introduction-to-apache-cxf)
- [Server-Sent Events (SSE) In JAX-RS](https://www.baeldung.com/java-ee-jax-rs-sse)
diff --git a/apache-meecrowave/README.md b/apache-meecrowave/README.md
index 42b93a383e..0dea60816b 100644
--- a/apache-meecrowave/README.md
+++ b/apache-meecrowave/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
================================
-- [Building a Microservice with Apache Meecrowave](http://www.baeldung.com/apache-meecrowave)
+- [Building a Microservice with Apache Meecrowave](https://www.baeldung.com/apache-meecrowave)
diff --git a/apache-olingo/README.md b/apache-olingo/README.md
index bfbdc97700..22fa6b3b51 100644
--- a/apache-olingo/README.md
+++ b/apache-olingo/README.md
@@ -1,3 +1,4 @@
## Relevant articles:
- [OData Protocol Guide](https://www.baeldung.com/odata)
+- [Intro to OData with Olingo](https://www.baeldung.com/olingo)
diff --git a/apache-opennlp/README.md b/apache-opennlp/README.md
index 2e9fa0e384..006ca588f2 100644
--- a/apache-opennlp/README.md
+++ b/apache-opennlp/README.md
@@ -1,3 +1,3 @@
### Relevant Articles
-- [Intro to Apache OpenNLP](http://www.baeldung.com/apache-open-nlp)
+- [Intro to Apache OpenNLP](https://www.baeldung.com/apache-open-nlp)
diff --git a/apache-poi/README.md b/apache-poi/README.md
index 862981991d..8ffd8ef517 100644
--- a/apache-poi/README.md
+++ b/apache-poi/README.md
@@ -1,4 +1,4 @@
### Relevant Articles:
-- [Microsoft Word Processing in Java with Apache POI](http://www.baeldung.com/java-microsoft-word-with-apache-poi)
-- [Working with Microsoft Excel in Java](http://www.baeldung.com/java-microsoft-excel)
-- [Creating a MS PowerPoint Presentation in Java](http://www.baeldung.com/apache-poi-slideshow)
+- [Microsoft Word Processing in Java with Apache POI](https://www.baeldung.com/java-microsoft-word-with-apache-poi)
+- [Working with Microsoft Excel in Java](https://www.baeldung.com/java-microsoft-excel)
+- [Creating a MS PowerPoint Presentation in Java](https://www.baeldung.com/apache-poi-slideshow)
diff --git a/apache-shiro/README.md b/apache-shiro/README.md
index bc3480b266..85f2a99a59 100644
--- a/apache-shiro/README.md
+++ b/apache-shiro/README.md
@@ -1,2 +1,2 @@
### Relevant articles
-- [Introduction to Apache Shiro](http://www.baeldung.com/apache-shiro)
+- [Introduction to Apache Shiro](https://www.baeldung.com/apache-shiro)
diff --git a/apache-solrj/README.md b/apache-solrj/README.md
index 7a32becb64..55f35b90a7 100644
--- a/apache-solrj/README.md
+++ b/apache-solrj/README.md
@@ -1,4 +1,4 @@
## Apache Solrj Tutorials Project
### Relevant Articles
-- [Guide to Solr in Java with Apache Solrj](http://www.baeldung.com/apache-solrj)
+- [Guide to Solr in Java with Apache Solrj](https://www.baeldung.com/apache-solrj)
diff --git a/apache-spark/README.md b/apache-spark/README.md
index a4dce212b4..a867fd57ff 100644
--- a/apache-spark/README.md
+++ b/apache-spark/README.md
@@ -1,4 +1,4 @@
### Relevant articles
-- [Introduction to Apache Spark](http://www.baeldung.com/apache-spark)
+- [Introduction to Apache Spark](https://www.baeldung.com/apache-spark)
- [Building a Data Pipeline with Kafka, Spark Streaming and Cassandra](https://www.baeldung.com/kafka-spark-data-pipeline)
diff --git a/apache-thrift/README.md b/apache-thrift/README.md
index d8b9195dcc..b90192f342 100644
--- a/apache-thrift/README.md
+++ b/apache-thrift/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [Working with Apache Thrift](http://www.baeldung.com/apache-thrift)
+- [Working with Apache Thrift](https://www.baeldung.com/apache-thrift)
diff --git a/apache-tika/README.md b/apache-tika/README.md
index b92a7bebf1..6f5fd054ca 100644
--- a/apache-tika/README.md
+++ b/apache-tika/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [Content Analysis with Apache Tika](http://www.baeldung.com/apache-tika)
+- [Content Analysis with Apache Tika](https://www.baeldung.com/apache-tika)
diff --git a/apache-velocity/README.md b/apache-velocity/README.md
index 53c67f847e..0d659a0381 100644
--- a/apache-velocity/README.md
+++ b/apache-velocity/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [Introduction to Apache Velocity](http://www.baeldung.com/apache-velocity)
+- [Introduction to Apache Velocity](https://www.baeldung.com/apache-velocity)
diff --git a/apache-zookeeper/README.md b/apache-zookeeper/README.md
index 6bddcfd5a8..d3ef944b0e 100644
--- a/apache-zookeeper/README.md
+++ b/apache-zookeeper/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [Getting Started with Java and Zookeeper](http://www.baeldung.com/java-zookeeper)
+- [Getting Started with Java and Zookeeper](https://www.baeldung.com/java-zookeeper)
diff --git a/asciidoctor/README.md b/asciidoctor/README.md
index 2124907e87..e8bf55792b 100644
--- a/asciidoctor/README.md
+++ b/asciidoctor/README.md
@@ -1,4 +1,4 @@
### Relevant articles
-- [Generating a Book with Asciidoctor](http://www.baeldung.com/asciidoctor-book)
-- [Introduction to Asciidoctor in Java](http://www.baeldung.com/asciidoctor)
+- [Generating a Book with Asciidoctor](https://www.baeldung.com/asciidoctor-book)
+- [Introduction to Asciidoctor in Java](https://www.baeldung.com/asciidoctor)
diff --git a/asm/README.md b/asm/README.md
index 50d9c34324..d12ee1ce13 100644
--- a/asm/README.md
+++ b/asm/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [A Guide to Java Bytecode Manipulation with ASM](http://www.baeldung.com/java-asm)
+- [A Guide to Java Bytecode Manipulation with ASM](https://www.baeldung.com/java-asm)
diff --git a/atomix/README.md b/atomix/README.md
index fb22eec8dc..c544458974 100644
--- a/atomix/README.md
+++ b/atomix/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [Introduction to Atomix](http://www.baeldung.com/atomix)
+- [Introduction to Atomix](https://www.baeldung.com/atomix)
diff --git a/autovalue/README.md b/autovalue/README.md
index f33ff6899f..7defca1161 100644
--- a/autovalue/README.md
+++ b/autovalue/README.md
@@ -1,4 +1,4 @@
### Relevant Articles:
-- [Introduction to AutoValue](http://www.baeldung.com/introduction-to-autovalue)
-- [Introduction to AutoFactory](http://www.baeldung.com/autofactory)
+- [Introduction to AutoValue](https://www.baeldung.com/introduction-to-autovalue)
+- [Introduction to AutoFactory](https://www.baeldung.com/autofactory)
- [Google AutoService](https://www.baeldung.com/google-autoservice)
diff --git a/aws-lambda/README.md b/aws-lambda/README.md
index 921b699bdd..a8f9f3e98a 100644
--- a/aws-lambda/README.md
+++ b/aws-lambda/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [Using AWS Lambda with API Gateway](http://www.baeldung.com/aws-lambda-api-gateway)
-- [Introduction to AWS Serverless Application Model](http://www.baeldung.com/aws-serverless)
+- [Using AWS Lambda with API Gateway](https://www.baeldung.com/aws-lambda-api-gateway)
+- [Introduction to AWS Serverless Application Model](https://www.baeldung.com/aws-serverless)
diff --git a/aws/README.md b/aws/README.md
index d14ea8a75e..b97db02723 100644
--- a/aws/README.md
+++ b/aws/README.md
@@ -1,11 +1,11 @@
### Relevant articles
-- [AWS Lambda Using DynamoDB With Java](http://www.baeldung.com/aws-lambda-dynamodb-java)
-- [AWS S3 with Java](http://www.baeldung.com/aws-s3-java)
-- [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda)
-- [Managing EC2 Instances in Java](http://www.baeldung.com/ec2-java)
-- [Multipart Uploads in Amazon S3 with Java](http://www.baeldung.com/aws-s3-multipart-upload)
-- [Integration Testing with a Local DynamoDB Instance](http://www.baeldung.com/dynamodb-local-integration-tests)
-- [Using the JetS3t Java Client With Amazon S3](http://www.baeldung.com/jets3t-amazon-s3)
-- [Managing Amazon SQS Queues in Java](http://www.baeldung.com/aws-queues-java)
+- [AWS Lambda Using DynamoDB With Java](https://www.baeldung.com/aws-lambda-dynamodb-java)
+- [AWS S3 with Java](https://www.baeldung.com/aws-s3-java)
+- [AWS Lambda With Java](https://www.baeldung.com/java-aws-lambda)
+- [Managing EC2 Instances in Java](https://www.baeldung.com/ec2-java)
+- [Multipart Uploads in Amazon S3 with Java](https://www.baeldung.com/aws-s3-multipart-upload)
+- [Integration Testing with a Local DynamoDB Instance](https://www.baeldung.com/dynamodb-local-integration-tests)
+- [Using the JetS3t Java Client With Amazon S3](https://www.baeldung.com/jets3t-amazon-s3)
+- [Managing Amazon SQS Queues in Java](https://www.baeldung.com/aws-queues-java)
- [Guide to AWS Aurora RDS with Java](https://www.baeldung.com/aws-aurora-rds-java)
diff --git a/axon/README.md b/axon/README.md
index f1ae5d00d8..8938be7ec2 100644
--- a/axon/README.md
+++ b/axon/README.md
@@ -1,3 +1,3 @@
### Relevant articles
-- [A Guide to the Axon Framework](http://www.baeldung.com/axon-cqrs-event-sourcing)
+- [A Guide to the Axon Framework](https://www.baeldung.com/axon-cqrs-event-sourcing)
diff --git a/azure/README.md b/azure/README.md
index ae8c443660..3c70622b85 100644
--- a/azure/README.md
+++ b/azure/README.md
@@ -1,4 +1,4 @@
### Relevant Articles:
-- [Deploy a Spring Boot App to Azure](http://www.baeldung.com/spring-boot-azure)
+- [Deploy a Spring Boot App to Azure](https://www.baeldung.com/spring-boot-azure)
diff --git a/blade/README.md b/blade/README.md
index 1f2a00ed3f..202494330f 100644
--- a/blade/README.md
+++ b/blade/README.md
@@ -1,5 +1,5 @@
### Relevant Articles:
-- [Blade – A Complete Guidebook](http://www.baeldung.com/blade)
+- [Blade – A Complete Guidebook](https://www.baeldung.com/blade)
Run Integration Tests with `mvn integration-test`
diff --git a/bootique/README.md b/bootique/README.md
index 2ef898fcf7..beb61c2a78 100644
--- a/bootique/README.md
+++ b/bootique/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Introduction to Bootique](http://www.baeldung.com/bootique)
+- [Introduction to Bootique](https://www.baeldung.com/bootique)
diff --git a/cdi/README.md b/cdi/README.md
index bfb635be9e..69ce285d7b 100644
--- a/cdi/README.md
+++ b/cdi/README.md
@@ -1,5 +1,5 @@
### Relevant Articles:
-- [CDI Interceptor vs Spring AspectJ](http://www.baeldung.com/cdi-interceptor-vs-spring-aspectj)
-- [An Introduction to CDI (Contexts and Dependency Injection) in Java](http://www.baeldung.com/java-ee-cdi)
+- [CDI Interceptor vs Spring AspectJ](https://www.baeldung.com/cdi-interceptor-vs-spring-aspectj)
+- [An Introduction to CDI (Contexts and Dependency Injection) in Java](https://www.baeldung.com/java-ee-cdi)
- [Introduction to the Event Notification Model in CDI 2.0](https://www.baeldung.com/cdi-event-notification)
diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java b/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java
index 4896408502..dc0bdeb951 100644
--- a/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java
+++ b/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java
@@ -1,15 +1,16 @@
-package com.baeldung.cdi.cdi2observers.application;
-
-import com.baeldung.cdi.cdi2observers.events.ExampleEvent;
-import javax.enterprise.inject.se.SeContainer;
-import javax.enterprise.inject.se.SeContainerInitializer;
-
-public class BootstrappingApplication {
-
- public static void main(String... args) {
- SeContainerInitializer containerInitializer = SeContainerInitializer.newInstance();
- try (SeContainer container = containerInitializer.initialize()) {
- container.getBeanManager().fireEvent(new ExampleEvent("Welcome to Baeldung!"));
- }
- }
-}
+package com.baeldung.cdi2observers.application;
+
+import com.baeldung.cdi2observers.events.ExampleEvent;
+
+import javax.enterprise.inject.se.SeContainer;
+import javax.enterprise.inject.se.SeContainerInitializer;
+
+public class BootstrappingApplication {
+
+ public static void main(String... args) {
+ SeContainerInitializer containerInitializer = SeContainerInitializer.newInstance();
+ try (SeContainer container = containerInitializer.initialize()) {
+ container.getBeanManager().fireEvent(new ExampleEvent("Welcome to Baeldung!"));
+ }
+ }
+}
diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java
index a2329d2ef1..9adfad4d39 100644
--- a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java
+++ b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java
@@ -1,14 +1,14 @@
-package com.baeldung.cdi.cdi2observers.events;
-
-public class ExampleEvent {
-
- private final String eventMessage;
-
- public ExampleEvent(String eventMessage) {
- this.eventMessage = eventMessage;
- }
-
- public String getEventMessage() {
- return eventMessage;
- }
-}
+package com.baeldung.cdi2observers.events;
+
+public class ExampleEvent {
+
+ private final String eventMessage;
+
+ public ExampleEvent(String eventMessage) {
+ this.eventMessage = eventMessage;
+ }
+
+ public String getEventMessage() {
+ return eventMessage;
+ }
+}
diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java
index f37030778a..5a0aa0b5e3 100644
--- a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java
+++ b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java
@@ -1,14 +1,14 @@
-package com.baeldung.cdi.cdi2observers.events;
-
-import javax.enterprise.event.Event;
-import javax.inject.Inject;
-
-public class ExampleEventSource {
-
- @Inject
- Event exampleEvent;
-
- public void fireEvent() {
- exampleEvent.fireAsync(new ExampleEvent("Welcome to Baeldung!"));
- }
-}
+package com.baeldung.cdi2observers.events;
+
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+
+public class ExampleEventSource {
+
+ @Inject
+ Event exampleEvent;
+
+ public void fireEvent() {
+ exampleEvent.fireAsync(new ExampleEvent("Welcome to Baeldung!"));
+ }
+}
diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java b/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java
index 34520c2b3d..3af48af13f 100644
--- a/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java
+++ b/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java
@@ -1,12 +1,13 @@
-package com.baeldung.cdi.cdi2observers.observers;
-
-import com.baeldung.cdi.cdi2observers.events.ExampleEvent;
-import javax.annotation.Priority;
-import javax.enterprise.event.Observes;
-
-public class AnotherExampleEventObserver {
-
- public String onEvent(@Observes @Priority(2) ExampleEvent event) {
- return event.getEventMessage();
- }
-}
+package com.baeldung.cdi2observers.observers;
+
+import com.baeldung.cdi2observers.events.ExampleEvent;
+
+import javax.annotation.Priority;
+import javax.enterprise.event.Observes;
+
+public class AnotherExampleEventObserver {
+
+ public String onEvent(@Observes @Priority(2) ExampleEvent event) {
+ return event.getEventMessage();
+ }
+}
diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java b/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java
index b3522b2ad0..33fdc43bbb 100644
--- a/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java
+++ b/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java
@@ -1,13 +1,13 @@
-package com.baeldung.cdi.cdi2observers.observers;
-
-import com.baeldung.cdi.cdi2observers.events.ExampleEvent;
-import com.baeldung.cdi.cdi2observers.services.TextService;
-import javax.annotation.Priority;
-import javax.enterprise.event.Observes;
-
-public class ExampleEventObserver {
-
- public String onEvent(@Observes @Priority(1) ExampleEvent event, TextService textService) {
- return textService.parseText(event.getEventMessage());
- }
-}
+package com.baeldung.cdi2observers.observers;
+
+import com.baeldung.cdi2observers.events.ExampleEvent;
+import com.baeldung.cdi2observers.services.TextService;
+import javax.annotation.Priority;
+import javax.enterprise.event.Observes;
+
+public class ExampleEventObserver {
+
+ public String onEvent(@Observes @Priority(1) ExampleEvent event, TextService textService) {
+ return textService.parseText(event.getEventMessage());
+ }
+}
diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java b/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java
index 47788a0657..eabe031223 100644
--- a/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java
+++ b/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java
@@ -1,8 +1,8 @@
-package com.baeldung.cdi.cdi2observers.services;
-
-public class TextService {
-
- public String parseText(String text) {
- return text.toUpperCase();
- }
-}
+package com.baeldung.cdi2observers.services;
+
+public class TextService {
+
+ public String parseText(String text) {
+ return text.toUpperCase();
+ }
+}
diff --git a/cdi/src/main/resources/META-INF/beans.xml b/cdi/src/main/resources/META-INF/beans.xml
index d41b35e7d9..144e9e567f 100644
--- a/cdi/src/main/resources/META-INF/beans.xml
+++ b/cdi/src/main/resources/META-INF/beans.xml
@@ -1,7 +1,8 @@
-
+
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
+ bean-discovery-mode="all">
com.baeldung.interceptor.AuditedInterceptor
diff --git a/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java b/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java
index deecf13f9a..1b976144aa 100644
--- a/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java
+++ b/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java
@@ -1,14 +1,15 @@
-package com.baeldung.cdi.cdi2observers.tests;
-
-import com.baeldung.cdi.cdi2observers.services.TextService;
-import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
-
-public class TextServiceUnitTest {
-
- @Test
- public void givenTextServiceInstance_whenCalledparseText_thenCorrect() {
- TextService textService = new TextService();
- assertThat(textService.parseText("Baeldung")).isEqualTo("BAELDUNG");
- }
-}
+package com.baeldung.test.cdi2observers.tests;
+
+import com.baeldung.cdi2observers.services.TextService;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class TextServiceUnitTest {
+
+ @Test
+ public void givenTextServiceInstance_whenCalledparseText_thenCorrect() {
+ TextService textService = new TextService();
+ assertThat(textService.parseText("Baeldung")).isEqualTo("BAELDUNG");
+ }
+}
diff --git a/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java b/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java
index caf2ed32b5..b22f189373 100644
--- a/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java
+++ b/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java
@@ -6,7 +6,6 @@ import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
public class TimeLoggerFactoryUnitTest {
-
@Test
public void givenTimeLoggerFactory_whenCalledgetTimeLogger_thenOneAssertion() {
TimeLoggerFactory timeLoggerFactory = new TimeLoggerFactory();
diff --git a/checker-plugin/README.md b/checker-plugin/README.md
index f4534b09e8..5c73b86f91 100644
--- a/checker-plugin/README.md
+++ b/checker-plugin/README.md
@@ -1,3 +1,3 @@
### Relevant articles
-- [The Checker Framework – Pluggable Type Systems for Java](http://www.baeldung.com/checker-framework)
+- [The Checker Framework – Pluggable Type Systems for Java](https://www.baeldung.com/checker-framework)
diff --git a/core-groovy-2/README.md b/core-groovy-2/README.md
index 1211dae76d..1dbfbd07a5 100644
--- a/core-groovy-2/README.md
+++ b/core-groovy-2/README.md
@@ -2,10 +2,10 @@
## Relevant articles:
-- [String Matching in Groovy](http://www.baeldung.com/)
- [Template Engines in Groovy](https://www.baeldung.com/groovy-template-engines)
- [Groovy def Keyword](https://www.baeldung.com/groovy-def-keyword)
- [Pattern Matching in Strings in Groovy](https://www.baeldung.com/groovy-pattern-matching)
- [Working with XML in Groovy](https://www.baeldung.com/groovy-xml)
- [Integrating Groovy into Java Applications](https://www.baeldung.com/groovy-java-applications)
- [Concatenate Strings with Groovy](https://www.baeldung.com/groovy-concatenate-strings)
+- [Metaprogramming in Groovy](https://www.baeldung.com/groovy-metaprogramming)
diff --git a/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy b/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy
new file mode 100644
index 0000000000..479c39699f
--- /dev/null
+++ b/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy
@@ -0,0 +1,17 @@
+package com.baeldung.category;
+
+class BaeldungCategory {
+
+ public static String capitalize(String self) {
+ String capitalizedStr = self;
+ if (self.size() > 0) {
+ capitalizedStr = self.substring(0, 1).toUpperCase() + self.substring(1);
+ }
+ return capitalizedStr
+ }
+
+ public static double toThePower(Number self, Number exponent) {
+ return Math.pow(self, exponent);
+ }
+
+}
diff --git a/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy b/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy
new file mode 100644
index 0000000000..ccf2ed519b
--- /dev/null
+++ b/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy
@@ -0,0 +1,17 @@
+package com.baeldung.category;
+
+import groovy.lang.Category
+
+@Category(Number)
+class NumberCategory {
+
+ public Number cube() {
+ return this*this*this
+ }
+
+ public int divideWithRoundUp(BigDecimal divisor, boolean isRoundUp) {
+ def mathRound = isRoundUp ? BigDecimal.ROUND_UP : BigDecimal.ROUND_DOWN
+ return (int)new BigDecimal(this).divide(divisor, 0, mathRound)
+ }
+
+}
diff --git a/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy
new file mode 100644
index 0000000000..a1f67b1e2e
--- /dev/null
+++ b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy
@@ -0,0 +1,101 @@
+package com.baeldung.category
+
+import groovy.time.*
+import java.text.SimpleDateFormat
+import groovy.xml.*
+import groovy.xml.dom.*
+import com.baeldung.category.BaeldungCategory
+import com.baeldung.category.NumberCategory
+
+class CategoryUnitTest extends GroovyTestCase {
+
+ void test_whenUsingTimeCategory_thenOperationOnDate() {
+ def jan_1_2019 = new Date("01/01/2019")
+ use (TimeCategory) {
+ assert jan_1_2019 + 10.seconds == new Date("01/01/2019 00:00:10")
+
+ assert jan_1_2019 + 20.minutes == new Date("01/01/2019 00:20:00")
+
+ assert jan_1_2019 + 2.hours == new Date("01/01/2019 02:00:00")
+
+ assert jan_1_2019 - 1.day == new Date("12/31/2018")
+
+ assert jan_1_2019 + 2.weeks == new Date("01/15/2019")
+
+ assert jan_1_2019 - 2.months == new Date("11/01/2018")
+
+ assert jan_1_2019 + 3.years == new Date("01/01/2022")
+ }
+ }
+
+ void test_whenUsingTimeCategory_thenOperationOnNumber() {
+ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy")
+ use (TimeCategory) {
+ assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days)
+
+ sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss")
+ assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes)
+ assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours)
+ }
+ }
+
+ void test_whenUsingDOMCategory_thenOperationOnXML() {
+
+ def baeldungArticlesText = """
+
+
+ An Intro to the Java Debug Interface (JDI)
+ A quick and practical overview of Java Debug Interface.
+
+
+ A Quick Guide to Working with Web Services in Groovy
+ Learn how to work with Web Services in Groovy.
+
+
+"""
+ def baeldungArticlesDom = DOMBuilder.newInstance().parseText(baeldungArticlesText)
+
+ def root = baeldungArticlesDom.documentElement
+
+ use (DOMCategory) {
+ assert root.article.size() == 2
+
+ def articles = root.article
+
+ assert articles[0].title.text() == "An Intro to the Java Debug Interface (JDI)"
+ assert articles[1].desc.text() == "Learn how to work with Web Services in Groovy."
+
+ def articleNode3 = root.appendNode(new QName("article"), ["core-java": "false"])
+
+ articleNode3.appendNode("title", "Metaprogramming in Groovy")
+ articleNode3.appendNode("desc", "Explore the concept of runtime and compile-time metaprogramming in Groovy")
+
+ assert root.article.size() == 3
+
+ assert root.article[2].title.text() == "Metaprogramming in Groovy"
+ }
+ }
+
+ void test_whenUsingBaeldungCategory_thenCapitalizeString() {
+ use (BaeldungCategory) {
+ assert "norman".capitalize() == "Norman"
+ }
+ }
+
+ void test_whenUsingBaeldungCategory_thenOperationsOnNumber() {
+ use (BaeldungCategory) {
+ assert 50.toThePower(2) == 2500
+ assert 2.4.toThePower(4) == 33.1776
+ }
+ }
+
+ void test_whenUsingNumberCategory_thenOperationsOnNumber() {
+ use (NumberCategory) {
+ assert 3.cube() == 27
+ assert 25.divideWithRoundUp(6, true) == 5
+ assert 120.23.divideWithRoundUp(6.1, true) == 20
+ assert 150.9.divideWithRoundUp(12.1, false) == 12
+ }
+ }
+
+}
diff --git a/core-groovy/README.md b/core-groovy/README.md
index 321c37be8d..2e62884b1f 100644
--- a/core-groovy/README.md
+++ b/core-groovy/README.md
@@ -2,8 +2,8 @@
## Relevant articles:
-- [JDBC with Groovy](http://www.baeldung.com/jdbc-groovy)
-- [Working with JSON in Groovy](http://www.baeldung.com/groovy-json)
+- [JDBC with Groovy](https://www.baeldung.com/jdbc-groovy)
+- [Working with JSON in Groovy](https://www.baeldung.com/groovy-json)
- [Reading a File in Groovy](https://www.baeldung.com/groovy-file-read)
- [Types of Strings in Groovy](https://www.baeldung.com/groovy-strings)
- [A Quick Guide to Iterating a Map in Groovy](https://www.baeldung.com/groovy-map-iterating)
@@ -12,4 +12,4 @@
- [Finding Elements in Collections in Groovy](https://www.baeldung.com/groovy-collections-find-elements)
- [Lists in Groovy](https://www.baeldung.com/groovy-lists)
- [Converting a String to a Date in Groovy](https://www.baeldung.com/groovy-string-to-date)
-- [Guide to I/O in Groovy](https://www.baeldung.com/groovy-io)
\ No newline at end of file
+- [Guide to I/O in Groovy](https://www.baeldung.com/groovy-io)
diff --git a/core-java-modules/core-java-8-2/README.md b/core-java-modules/core-java-8-2/README.md
index d11510b2aa..4952cf4eb7 100644
--- a/core-java-modules/core-java-8-2/README.md
+++ b/core-java-modules/core-java-8-2/README.md
@@ -5,6 +5,6 @@
### Relevant Articles:
- [Anonymous Classes in Java](http://www.baeldung.com/)
- [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution)
-- [Run JAR Application With Command Line Arguments](https://www.baeldung.com/java-run-jar-with-arguments)
+- [Run a Java Application from the Command Line](https://www.baeldung.com/java-run-jar-with-arguments)
- [Java 8 Stream skip() vs limit()](https://www.baeldung.com/java-stream-skip-vs-limit)
- [Guide to Java BiFunction Interface](https://www.baeldung.com/java-bifunction-interface)
diff --git a/core-java-modules/core-java-8/README.md b/core-java-modules/core-java-8/README.md
index aee7121fb3..6d69d30d00 100644
--- a/core-java-modules/core-java-8/README.md
+++ b/core-java-modules/core-java-8/README.md
@@ -3,35 +3,12 @@
## Core Java 8 Cookbooks and Examples
### Relevant Articles:
-- [Guide to Java 8’s Collectors](http://www.baeldung.com/java-8-collectors)
-- [New Features in Java 8](http://www.baeldung.com/java-8-new-features)
-- [The Double Colon Operator in Java 8](http://www.baeldung.com/java-8-double-colon-operator)
-- [Guide to Java 8 groupingBy Collector](http://www.baeldung.com/java-groupingby-collector)
-- [Strategy Design Pattern in Java 8](http://www.baeldung.com/java-strategy-pattern)
-- [Guide to Java 8 Comparator.comparing()](http://www.baeldung.com/java-8-comparator-comparing)
-- [Guide To Java 8 Optional](http://www.baeldung.com/java-optional)
-- [Guide to the Java 8 forEach](http://www.baeldung.com/foreach-java)
-- [The Difference Between map() and flatMap()](http://www.baeldung.com/java-difference-map-and-flatmap)
-- [Static and Default Methods in Interfaces in Java](http://www.baeldung.com/java-static-default-methods)
-- [Efficient Word Frequency Calculator in Java](http://www.baeldung.com/java-word-frequency)
-- [Introduction to Spliterator in Java](http://www.baeldung.com/java-spliterator)
-- [Java 8 Math New Methods](http://www.baeldung.com/java-8-math)
-- [Overview of Java Built-in Annotations](http://www.baeldung.com/java-default-annotations)
-- [Finding Min/Max in an Array with Java](http://www.baeldung.com/java-array-min-max)
-- [Internationalization and Localization in Java 8](http://www.baeldung.com/java-8-localization)
-- [Java Optional – orElse() vs orElseGet()](http://www.baeldung.com/java-optional-or-else-vs-or-else-get)
-- [Java 8 Unsigned Arithmetic Support](http://www.baeldung.com/java-unsigned-arithmetic)
-- [Generalized Target-Type Inference in Java](http://www.baeldung.com/java-generalized-target-type-inference)
-- [Overriding System Time for Testing in Java](http://www.baeldung.com/java-override-system-time)
-- [Set the Time Zone of a Date in Java](https://www.baeldung.com/java-set-date-time-zone)
-- [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance)
-- [Java Primitives versus Objects](https://www.baeldung.com/java-primitives-vs-objects)
-- [How to Use if/else Logic in Java 8 Streams](https://www.baeldung.com/java-8-streams-if-else-logic)
-- [How to Replace Many if Statements in Java](https://www.baeldung.com/java-replace-if-statements)
-- [Java @Override Annotation](https://www.baeldung.com/java-override)
-- [Java @SuppressWarnings Annotation](https://www.baeldung.com/java-suppresswarnings)
-- [Java @SafeVarargs Annotation](https://www.baeldung.com/java-safevarargs)
-- [Java @Deprecated Annotation](https://www.baeldung.com/java-deprecated)
-- [Java 8 Predicate Chain](https://www.baeldung.com/java-predicate-chain)
-- [Creating a Custom Annotation in Java](https://www.baeldung.com/java-custom-annotation)
-- [The Difference Between Collection.stream().forEach() and Collection.forEach()](https://www.baeldung.com/java-collection-stream-foreach)
+- [New Features in Java 8](https://www.baeldung.com/java-8-new-features)
+- [Guide to Java 8 groupingBy Collector](https://www.baeldung.com/java-groupingby-collector)
+- [Strategy Design Pattern in Java 8](https://www.baeldung.com/java-strategy-pattern)
+- [Guide to Java 8 Comparator.comparing()](https://www.baeldung.com/java-8-comparator-comparing)
+- [Guide to the Java 8 forEach](https://www.baeldung.com/foreach-java)
+- [Introduction to Spliterator in Java](https://www.baeldung.com/java-spliterator)
+- [Finding Min/Max in an Array with Java](https://www.baeldung.com/java-array-min-max)
+- [Internationalization and Localization in Java 8](https://www.baeldung.com/java-8-localization)
+- [Generalized Target-Type Inference in Java](https://www.baeldung.com/java-generalized-target-type-inference)
diff --git a/core-java-modules/core-java-8/pom.xml b/core-java-modules/core-java-8/pom.xml
index 6e547b7fad..9ef3cd1201 100644
--- a/core-java-modules/core-java-8/pom.xml
+++ b/core-java-modules/core-java-8/pom.xml
@@ -116,12 +116,6 @@
${powermock.version}test
-
- org.jmockit
- jmockit
- ${jmockit.version}
- test
-
@@ -150,16 +144,6 @@
-
- maven-surefire-plugin
- ${maven-surefire-plugin.version}
-
-
- -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
-
- true
-
-
@@ -176,7 +160,6 @@
3.6.11.8.92.0.0-RC.4
- 1.441.7.01.191.19
diff --git a/core-java-modules/core-java-annotations/README.md b/core-java-modules/core-java-annotations/README.md
new file mode 100644
index 0000000000..a125e8abd5
--- /dev/null
+++ b/core-java-modules/core-java-annotations/README.md
@@ -0,0 +1,11 @@
+=========
+
+## Core Java 8 Cookbooks and Examples
+
+### Relevant Articles:
+- [Java @Override Annotation](https://www.baeldung.com/java-override)
+- [Java @SuppressWarnings Annotation](https://www.baeldung.com/java-suppresswarnings)
+- [Java @SafeVarargs Annotation](https://www.baeldung.com/java-safevarargs)
+- [Java @Deprecated Annotation](https://www.baeldung.com/java-deprecated)
+- [Overview of Java Built-in Annotations](https://www.baeldung.com/java-default-annotations)
+- [Creating a Custom Annotation in Java](https://www.baeldung.com/java-custom-annotation)
\ No newline at end of file
diff --git a/core-java-modules/core-java-annotations/pom.xml b/core-java-modules/core-java-annotations/pom.xml
new file mode 100644
index 0000000000..7d7d7d4f7e
--- /dev/null
+++ b/core-java-modules/core-java-annotations/pom.xml
@@ -0,0 +1,72 @@
+
+ 4.0.0
+ com.baeldung
+ core-java-annotations
+ 0.1.0-SNAPSHOT
+ core-java-annotations
+ jar
+
+
+ com.baeldung
+ parent-java
+ 0.0.1-SNAPSHOT
+ ../../parent-java
+
+
+
+
+ org.apache.commons
+ commons-lang3
+ ${commons-lang3.version}
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+ provided
+
+
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
+
+ org.openjdk.jmh
+ jmh-core
+ ${jmh-core.version}
+
+
+ org.openjdk.jmh
+ jmh-generator-annprocess
+ ${jmh-generator.version}
+
+
+ org.openjdk.jmh
+ jmh-generator-bytecode
+ ${jmh-generator.version}
+
+
+
+
+ core-java-annotations
+
+
+ src/main/resources
+ true
+
+
+
+
+
+
+ 3.6.1
+ 1.8.9
+ 1.19
+ 1.19
+
+ 2.22.1
+
+
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntConsumer.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntConsumer.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntConsumer.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntConsumer.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Interval.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Interval.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Interval.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Interval.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntervalUsage.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntervalUsage.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntervalUsage.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntervalUsage.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Intervals.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Intervals.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Intervals.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Intervals.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotation.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotation.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotation.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotation.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperation.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperation.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperation.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperation.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperationImpl.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperationImpl.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperationImpl.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperationImpl.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Init.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Init.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Init.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Init.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonElement.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonElement.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonElement.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonElement.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializable.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializable.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializable.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializable.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializationException.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializationException.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializationException.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializationException.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Person.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Person.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Person.java
rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Person.java
diff --git a/maven/src/main/resources/logback.xml b/core-java-modules/core-java-annotations/src/main/resources/logback.xml
similarity index 100%
rename from maven/src/main/resources/logback.xml
rename to core-java-modules/core-java-annotations/src/main/resources/logback.xml
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java b/core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java
rename to core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java
diff --git a/core-java-modules/core-java-arrays-2/.gitignore b/core-java-modules/core-java-arrays-2/.gitignore
deleted file mode 100644
index 374c8bf907..0000000000
--- a/core-java-modules/core-java-arrays-2/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-*.class
-
-0.*
-
-#folders#
-/target
-/neoDb*
-/data
-/src/main/webapp/WEB-INF/classes
-*/META-INF/*
-.resourceCache
-
-# Packaged files #
-*.jar
-*.war
-*.ear
-
-# Files generated by integration tests
-backup-pom.xml
-/bin/
-/temp
-
-#IntelliJ specific
-.idea/
-*.iml
\ No newline at end of file
diff --git a/core-java-modules/core-java-arrays-2/README.MD b/core-java-modules/core-java-arrays-2/README.MD
index f272f4d299..952770a2da 100644
--- a/core-java-modules/core-java-arrays-2/README.MD
+++ b/core-java-modules/core-java-arrays-2/README.MD
@@ -1,5 +1,10 @@
## Relevant Articles
- [Extending an Array’s Length](https://www.baeldung.com/java-array-add-element-at-the-end)
-- [Checking If an Array Is Sorted in Java](https://www.baeldung.com/java-check-sorted-array)
- [Looping Diagonally Through a 2d Java Array](https://www.baeldung.com/java-loop-diagonal-array)
+- [Converting Between Stream and Array in Java](https://www.baeldung.com/java-stream-to-array)
+- [Convert a Float to a Byte Array in Java](https://www.baeldung.com/java-convert-float-to-byte-array)
+- [Array Operations in Java](https://www.baeldung.com/java-common-array-operations)
+- [Intersection Between two Integer Arrays](https://www.baeldung.com/java-array-intersection)
+- [Removing an Element from an Array in Java](https://www.baeldung.com/java-array-remove-element)
+- [Removing the First Element of an Array](https://www.baeldung.com/java-array-remove-first-element)
diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/AddElementToEndOfArray.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/AddElementToEndOfArray.java
similarity index 100%
rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/AddElementToEndOfArray.java
rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/AddElementToEndOfArray.java
diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java
similarity index 100%
rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java
rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java
diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java
similarity index 100%
rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java
rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java
diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/operations/ArrayOperations.java
similarity index 97%
rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java
rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/operations/ArrayOperations.java
index d8cc0afd61..94a00f7aba 100644
--- a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java
+++ b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/operations/ArrayOperations.java
@@ -1,19 +1,14 @@
package com.baeldung.array.operations;
+import org.apache.commons.lang3.ArrayUtils;
+
import java.lang.reflect.Array;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.Random;
-import java.util.Set;
+import java.util.*;
import java.util.function.Function;
import java.util.function.IntPredicate;
import java.util.function.Predicate;
import java.util.stream.Stream;
-import org.apache.commons.lang3.ArrayUtils;
-
public class ArrayOperations {
// Get the first and last item of an array
diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java
rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java
diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java
similarity index 91%
rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java
rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java
index ea52cd17d9..567b870ef1 100644
--- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java
+++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java
@@ -1,13 +1,10 @@
package com.baeldung.array;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.*;
+
class RemoveElementFromAnArrayUnitTest {
private final RemoveElementFromAnArray sut = new RemoveElementFromAnArray();
diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java
similarity index 80%
rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java
rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java
index a2cd273f21..7656783052 100644
--- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java
+++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java
@@ -1,12 +1,10 @@
package com.baeldung.array.conversions;
-import static com.baeldung.array.conversions.FloatToByteArray.byteArrayToFloat;
-import static com.baeldung.array.conversions.FloatToByteArray.byteArrayToFloatWithByteBuffer;
-import static com.baeldung.array.conversions.FloatToByteArray.floatToByteArray;
-import static com.baeldung.array.conversions.FloatToByteArray.floatToByteArrayWithByteBuffer;
+import org.junit.Test;
+
+import static com.baeldung.array.conversions.FloatToByteArray.*;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
-import org.junit.Test;
public class FloatToByteArrayUnitTest {
diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java
rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java
index a9c6d97d9f..d72681ca05 100644
--- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java
+++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java
@@ -1,13 +1,13 @@
package com.baeldung.array.operations;
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.Arrays;
-
import org.assertj.core.api.Condition;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import java.util.Arrays;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
public class ArrayOperationsUnitTest {
private Integer[] defaultObjectArray;
diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java
similarity index 91%
rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java
rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java
index 3c61060ea8..1560cc5701 100644
--- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java
+++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java
@@ -2,9 +2,7 @@ package com.baeldung.array.operations;
import org.junit.jupiter.api.Test;
-import static com.baeldung.array.operations.ArrayOperations.intersectionMultiSet;
-import static com.baeldung.array.operations.ArrayOperations.intersectionSet;
-import static com.baeldung.array.operations.ArrayOperations.intersectionSimple;
+import static com.baeldung.array.operations.ArrayOperations.*;
import static org.assertj.core.api.Assertions.assertThat;
class IntersectionUnitTest {
diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/removefirst/RemoveFirstElementUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/removefirst/RemoveFirstElementUnitTest.java
similarity index 97%
rename from core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/removefirst/RemoveFirstElementUnitTest.java
rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/removefirst/RemoveFirstElementUnitTest.java
index f2b1bd9d88..83a97973f3 100644
--- a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/removefirst/RemoveFirstElementUnitTest.java
+++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/removefirst/RemoveFirstElementUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.list.removefirst;
+package com.baeldung.array.removefirst;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
diff --git a/core-java-modules/core-java-arrays/.gitignore b/core-java-modules/core-java-arrays/.gitignore
deleted file mode 100644
index 374c8bf907..0000000000
--- a/core-java-modules/core-java-arrays/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-*.class
-
-0.*
-
-#folders#
-/target
-/neoDb*
-/data
-/src/main/webapp/WEB-INF/classes
-*/META-INF/*
-.resourceCache
-
-# Packaged files #
-*.jar
-*.war
-*.ear
-
-# Files generated by integration tests
-backup-pom.xml
-/bin/
-/temp
-
-#IntelliJ specific
-.idea/
-*.iml
\ No newline at end of file
diff --git a/core-java-modules/core-java-arrays/README.md b/core-java-modules/core-java-arrays/README.md
index 45feff3edc..36d2d4c4ad 100644
--- a/core-java-modules/core-java-arrays/README.md
+++ b/core-java-modules/core-java-arrays/README.md
@@ -3,17 +3,14 @@
## Core Java Arrays Cookbooks and Examples
### Relevant Articles:
-- [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy)
-- [Check if a Java Array Contains a Value](http://www.baeldung.com/java-array-contains-value)
-- [Initializing Arrays in Java](http://www.baeldung.com/java-initialize-array)
-- [Guide to the java.util.Arrays Class](http://www.baeldung.com/java-util-arrays)
-- [Multi-Dimensional Arrays In Java](http://www.baeldung.com/java-jagged-arrays)
-- [Find Sum and Average in a Java Array](http://www.baeldung.com/java-array-sum-average)
+- [How to Copy an Array in Java](https://www.baeldung.com/java-array-copy)
+- [Check if a Java Array Contains a Value](https://www.baeldung.com/java-array-contains-value)
+- [Initializing Arrays in Java](https://www.baeldung.com/java-initialize-array)
+- [Guide to the java.util.Arrays Class](https://www.baeldung.com/java-util-arrays)
+- [Multi-Dimensional Arrays In Java](https://www.baeldung.com/java-jagged-arrays)
+- [Find Sum and Average in a Java Array](https://www.baeldung.com/java-array-sum-average)
- [Arrays in Java: A Reference Guide](https://www.baeldung.com/java-arrays-guide)
-- [How to Invert an Array in Java](http://www.baeldung.com/java-invert-array)
-- [Array Operations in Java](http://www.baeldung.com/java-common-array-operations)
-- [Intersection Between two Integer Arrays](https://www.baeldung.com/java-array-intersection)
+- [Read and Write User Input in Java](https://www.baeldung.com/java-console-input-output)
+- [How to Reverse an Array in Java](http://www.baeldung.com/java-invert-array)
- [Sorting Arrays in Java](https://www.baeldung.com/java-sorting-arrays)
-- [Convert a Float to a Byte Array in Java](https://www.baeldung.com/java-convert-float-to-byte-array)
-- [Converting Between Stream and Array in Java](https://www.baeldung.com/java-stream-to-array)
-- [Removing an Element from an Array in Java](https://www.baeldung.com/java-array-remove-element)
+- [Checking If an Array Is Sorted in Java](https://www.baeldung.com/java-check-sorted-array)
diff --git a/core-java-modules/core-java-collections-2/README.md b/core-java-modules/core-java-collections-2/README.md
new file mode 100644
index 0000000000..13ca191edb
--- /dev/null
+++ b/core-java-modules/core-java-collections-2/README.md
@@ -0,0 +1,15 @@
+=========
+
+## Core Java Collections Cookbooks and Examples
+
+### Relevant Articles:
+- [Removing Elements from Java Collections](https://www.baeldung.com/java-collection-remove-elements)
+- [How to Filter a Collection in Java](https://www.baeldung.com/java-collection-filtering)
+- [Join and Split Arrays and Collections in Java](https://www.baeldung.com/java-join-and-split)
+- [Java – Combine Multiple Collections](https://www.baeldung.com/java-combine-multiple-collections)
+- [Combining Different Types of Collections in Java](https://www.baeldung.com/java-combine-collections)
+- [Shuffling Collections In Java](https://www.baeldung.com/java-shuffle-collection)
+- [Sorting in Java](https://www.baeldung.com/java-sorting)
+- [Getting the Size of an Iterable in Java](https://www.baeldung.com/java-iterable-size)
+- [Java Null-Safe Streams from Collections](https://www.baeldung.com/java-null-safe-streams-from-collections)
+
diff --git a/core-java-modules/core-java-collections-2/pom.xml b/core-java-modules/core-java-collections-2/pom.xml
new file mode 100644
index 0000000000..0ac53ec180
--- /dev/null
+++ b/core-java-modules/core-java-collections-2/pom.xml
@@ -0,0 +1,58 @@
+
+ 4.0.0
+ core-java-collections-2
+ 0.0.1-SNAPSHOT
+ core-java-collections-2
+ jar
+
+
+ com.baeldung
+ parent-java
+ 0.0.1-SNAPSHOT
+ ../../parent-java
+
+
+
+
+ org.eclipse.collections
+ eclipse-collections
+ ${eclipse.collections.version}
+
+
+ org.apache.commons
+ commons-collections4
+ ${commons-collections4.version}
+
+
+ org.apache.commons
+ commons-exec
+ ${commons-exec.version}
+
+
+ org.apache.commons
+ commons-lang3
+ ${commons-lang3.version}
+
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
+
+ org.junit.platform
+ junit-platform-runner
+ ${junit.platform.version}
+ test
+
+
+
+
+ 7.1.0
+ 4.1
+ 3.11.1
+ 1.2.0
+ 1.3
+
+
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningArrays.java
similarity index 95%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningArrays.java
index 2ad48033c0..5f63123f6a 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningArrays.java
@@ -1,4 +1,4 @@
-package com.baeldung.combiningcollections;
+package com.baeldung.collections.combiningcollections;
import java.util.Arrays;
import java.util.stream.Stream;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningLists.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningLists.java
index 3fdf672758..a45e9cdfe8 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningLists.java
@@ -1,4 +1,4 @@
-package com.baeldung.combiningcollections;
+package com.baeldung.collections.combiningcollections;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningMaps.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningMaps.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningMaps.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningMaps.java
index d8bbd01ed3..d4d21d0dad 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningMaps.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningMaps.java
@@ -1,4 +1,4 @@
-package com.baeldung.combiningcollections;
+package com.baeldung.collections.combiningcollections;
import java.util.Collection;
import java.util.HashMap;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningSets.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningSets.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningSets.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningSets.java
index 5f531c1d43..27a5681eee 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningSets.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningSets.java
@@ -1,4 +1,4 @@
-package com.baeldung.combiningcollections;
+package com.baeldung.collections.combiningcollections;
import java.util.Collection;
import java.util.HashSet;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/CollectionUtilsCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/CollectionUtilsCollectionFilter.java
similarity index 91%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/CollectionUtilsCollectionFilter.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/CollectionUtilsCollectionFilter.java
index 58f9f6af54..de5158e147 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/CollectionUtilsCollectionFilter.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/CollectionUtilsCollectionFilter.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.filtering;
+package com.baeldung.collections.filtering;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/EclipseCollectionsCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/EclipseCollectionsCollectionFilter.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/EclipseCollectionsCollectionFilter.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/EclipseCollectionsCollectionFilter.java
index 981d6ca241..a7b78b1f9b 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/EclipseCollectionsCollectionFilter.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/EclipseCollectionsCollectionFilter.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.filtering;
+package com.baeldung.collections.filtering;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/GuavaCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/GuavaCollectionFilter.java
similarity index 91%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/GuavaCollectionFilter.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/GuavaCollectionFilter.java
index 88338fd6d4..0a2a782c33 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/GuavaCollectionFilter.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/GuavaCollectionFilter.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.filtering;
+package com.baeldung.collections.filtering;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/StreamsCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/StreamsCollectionFilter.java
similarity index 95%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/StreamsCollectionFilter.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/StreamsCollectionFilter.java
index f074f74199..a9fb8481e5 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/StreamsCollectionFilter.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/StreamsCollectionFilter.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.filtering;
+package com.baeldung.collections.filtering;
import java.util.Collection;
import java.util.function.Predicate;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize/IterableSize.java
similarity index 97%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize/IterableSize.java
index 03864f16f2..b96e2bb571 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize/IterableSize.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.iterable;
+package com.baeldung.collections.iterablesize;
import java.util.Collection;
import java.util.stream.StreamSupport;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java
similarity index 92%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java
index 2405c26aac..ce5cbb39d6 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java
@@ -1,4 +1,4 @@
-package com.baeldung.nullsafecollectionstreams;
+package com.baeldung.collections.nullsafecollectionstreams;
import java.util.Collection;
import java.util.stream.Stream;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java
similarity index 92%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java
index da767d4563..68d51c2d87 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java
@@ -1,4 +1,4 @@
-package com.baeldung.nullsafecollectionstreams;
+package com.baeldung.collections.nullsafecollectionstreams;
import java.util.Collection;
import java.util.Optional;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java
similarity index 91%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java
index 0c10f1cebc..6c606ebedd 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java
@@ -1,4 +1,4 @@
-package com.baeldung.nullsafecollectionstreams;
+package com.baeldung.collections.nullsafecollectionstreams;
import java.util.Collection;
import java.util.stream.Stream;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/CollectionRemoveIf.java
similarity index 91%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/CollectionRemoveIf.java
index 2f5e91596f..4089382376 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/CollectionRemoveIf.java
@@ -1,4 +1,4 @@
-package com.baeldung.removal;
+package com.baeldung.collections.removal;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/Iterators.java
similarity index 93%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/Iterators.java
index 86b91b3fdc..d551b04eae 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/Iterators.java
@@ -1,4 +1,4 @@
-package com.baeldung.removal;
+package com.baeldung.collections.removal;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamFilterAndCollector.java
similarity index 93%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamFilterAndCollector.java
index bf6db68bae..e0dc75f428 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamFilterAndCollector.java
@@ -1,4 +1,4 @@
-package com.baeldung.removal;
+package com.baeldung.collections.removal;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamPartitioningBy.java
similarity index 95%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java
rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamPartitioningBy.java
index c77e996616..c01c334f01 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java
+++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamPartitioningBy.java
@@ -1,4 +1,4 @@
-package com.baeldung.removal;
+package com.baeldung.collections.removal;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningArraysUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningArraysUnitTest.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningArraysUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningArraysUnitTest.java
index 3b80d773ad..312f5582ba 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningArraysUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningArraysUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.combiningcollections;
+package com.baeldung.collections.combiningcollections;
import static org.junit.Assert.*;
import org.junit.Test;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningListsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningListsUnitTest.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningListsUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningListsUnitTest.java
index c5851d7daf..5443e56e5f 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningListsUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningListsUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.combiningcollections;
+package com.baeldung.collections.combiningcollections;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningMapsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningMapsUnitTest.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningMapsUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningMapsUnitTest.java
index 3fa9cc7dc4..644f178f80 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningMapsUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningMapsUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.combiningcollections;
+package com.baeldung.collections.combiningcollections;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningSetsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningSetsUnitTest.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningSetsUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningSetsUnitTest.java
index 330827bdc2..c9976eb6de 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningSetsUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningSetsUnitTest.java
@@ -1,5 +1,5 @@
-package com.baeldung.combiningcollections;
+package com.baeldung.collections.combiningcollections;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/filtering/CollectionFiltersUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/filtering/CollectionFiltersUnitTest.java
similarity index 98%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/java/filtering/CollectionFiltersUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/filtering/CollectionFiltersUnitTest.java
index b30805d471..db387818b8 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/filtering/CollectionFiltersUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/filtering/CollectionFiltersUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.filtering;
+package com.baeldung.collections.filtering;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/iterable/IterableSizeUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize/IterableSizeUnitTest.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/java/iterable/IterableSizeUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize/IterableSizeUnitTest.java
index 4bc413dee0..35702a74b3 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/iterable/IterableSizeUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize/IterableSizeUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.iterable;
+package com.baeldung.collections.iterablesize;
import static org.junit.Assert.assertEquals;
diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/CollectionsJoinAndSplitJUnitTest.java
similarity index 97%
rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/CollectionsJoinAndSplitJUnitTest.java
index c288cf499d..1904fd1587 100644
--- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/CollectionsJoinAndSplitJUnitTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.java.collections;
+package com.baeldung.collections.joinsplit;
import java.util.ArrayList;
import java.util.Collections;
diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/JoinSplitCollectionsUnitTest.java
similarity index 99%
rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/JoinSplitCollectionsUnitTest.java
index c594529f41..1fbe210ad4 100644
--- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/JoinSplitCollectionsUnitTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.java.collections;
+package com.baeldung.collections.joinsplit;
import org.junit.Test;
diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java
similarity index 98%
rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java
index d43075c925..ebef8d6875 100644
--- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.java.collections;
+package com.baeldung.collections.multiplecollections;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@@ -14,7 +14,7 @@ import java.util.stream.Stream;
import static java.util.Arrays.asList;
-public class CollectionsConcatenateUnitTest {
+public class CombineMultipleCollectionsUnitTest {
@Test
public void givenUsingJava8_whenConcatenatingUsingConcat_thenCorrect() {
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java
similarity index 95%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java
index 875045946d..42cda7926c 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.nullsafecollectionstreams;
+package com.baeldung.collections.nullsafecollectionstreams;
import java.util.Arrays;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java
similarity index 95%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java
index 402f1a6a19..666d5e7d04 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.nullsafecollectionstreams;
+package com.baeldung.collections.nullsafecollectionstreams;
import java.util.Arrays;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java
similarity index 95%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java
index bb6152371d..2e8eeb35ad 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.nullsafecollectionstreams;
+package com.baeldung.collections.nullsafecollectionstreams;
import java.util.Arrays;
import java.util.Collection;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/removal/RemovalUnitTest.java
similarity index 98%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/removal/RemovalUnitTest.java
index 1b379f32de..998dbe6cca 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/removal/RemovalUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.removal;
+package com.baeldung.collections.removal;
import org.junit.Before;
import org.junit.Test;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/shufflingcollections/ShufflingCollectionsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/shufflingcollections/ShufflingCollectionsUnitTest.java
similarity index 97%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/shufflingcollections/ShufflingCollectionsUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/shufflingcollections/ShufflingCollectionsUnitTest.java
index d013907c9a..041e67ba7f 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/shufflingcollections/ShufflingCollectionsUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/shufflingcollections/ShufflingCollectionsUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.shufflingcollections;
+package com.baeldung.collections.shufflingcollections;
import org.junit.Test;
diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/Employee.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/Employee.java
index 99af49c8d3..e838dbea18 100644
--- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/Employee.java
@@ -1,4 +1,4 @@
-package org.baeldung.java.sorting;
+package com.baeldung.collections.sorting;
public class Employee implements Comparable {
diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/JavaSortingUnitTest.java
similarity index 99%
rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java
rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/JavaSortingUnitTest.java
index ca9c9b4b5d..2505adcea7 100644
--- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java
+++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/JavaSortingUnitTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.java.sorting;
+package com.baeldung.collections.sorting;
import com.google.common.primitives.Ints;
import org.apache.commons.lang3.ArrayUtils;
diff --git a/core-java-modules/core-java-collections-3/README.md b/core-java-modules/core-java-collections-3/README.md
new file mode 100644
index 0000000000..9218384640
--- /dev/null
+++ b/core-java-modules/core-java-collections-3/README.md
@@ -0,0 +1,11 @@
+=========
+
+## Core Java Collections Cookbooks and Examples
+
+### Relevant Articles:
+- [Time Comparison of Arrays.sort(Object[]) and Arrays.sort(int[])](https://www.baeldung.com/arrays-sortobject-vs-sortint)
+- [Java ArrayList vs Vector](https://www.baeldung.com/java-arraylist-vs-vector)
+- [Differences Between HashMap and Hashtable](https://www.baeldung.com/hashmap-hashtable-differences)
+- [Differences Between Collection.clear() and Collection.removeAll()](https://www.baeldung.com/java-collection-clear-vs-removeall)
+- [Performance of contains() in a HashSet vs ArrayList](https://www.baeldung.com/java-hashset-arraylist-contains-performance)
+- [Fail-Safe Iterator vs Fail-Fast Iterator](https://www.baeldung.com/java-fail-safe-vs-fail-fast-iterator)
diff --git a/core-java-modules/core-java-collections-3/pom.xml b/core-java-modules/core-java-collections-3/pom.xml
new file mode 100644
index 0000000000..84c7865e68
--- /dev/null
+++ b/core-java-modules/core-java-collections-3/pom.xml
@@ -0,0 +1,34 @@
+
+ 4.0.0
+ core-java-collections-3
+ 0.1.0-SNAPSHOT
+ core-java-collections-3
+ jar
+
+
+ com.baeldung
+ parent-java
+ 0.0.1-SNAPSHOT
+ ../../parent-java
+
+
+
+
+ org.openjdk.jmh
+ jmh-core
+ ${openjdk.jmh.version}
+
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
+
+
+
+ 1.19
+ 3.11.1
+
+
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArrayListBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/ArrayListBenchmark.java
similarity index 98%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArrayListBenchmark.java
rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/ArrayListBenchmark.java
index 331ae8d908..7fcadf019c 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArrayListBenchmark.java
+++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/ArrayListBenchmark.java
@@ -1,4 +1,4 @@
-package com.baeldung.performance;
+package com.baeldung.collections.arraylistvsvector;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.runner.Runner;
diff --git a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java
new file mode 100644
index 0000000000..02f25a7558
--- /dev/null
+++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java
@@ -0,0 +1,55 @@
+package com.baeldung.collections.arraylistvsvector;
+
+public class Employee {
+
+ private Long id;
+ private String name;
+
+ public Employee(Long id, String name) {
+ this.name = name;
+ this.id = id;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Employee employee = (Employee) o;
+
+ if (!id.equals(employee.id)) return false;
+ return name.equals(employee.name);
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = id.hashCode();
+ result = 31 * result + name.hashCode();
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "Employee{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
+ '}';
+ }
+}
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/list/VectorExample.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/VectorExample.java
similarity index 92%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/list/VectorExample.java
rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/VectorExample.java
index 7debc07911..e82e47cdbb 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/list/VectorExample.java
+++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/VectorExample.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.list;
+package com.baeldung.collections.arraylistvsvector;
import java.util.Enumeration;
import java.util.Iterator;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/CollectionsBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/CollectionsBenchmark.java
similarity index 96%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/CollectionsBenchmark.java
rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/CollectionsBenchmark.java
index 921e1608ea..76edd10e92 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/CollectionsBenchmark.java
+++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/CollectionsBenchmark.java
@@ -1,4 +1,4 @@
-package com.baeldung.performance;
+package com.baeldung.collections.containsperformance;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.runner.Runner;
diff --git a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java
new file mode 100644
index 0000000000..6c60f8772c
--- /dev/null
+++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java
@@ -0,0 +1,55 @@
+package com.baeldung.collections.containsperformance;
+
+public class Employee {
+
+ private Long id;
+ private String name;
+
+ public Employee(Long id, String name) {
+ this.name = name;
+ this.id = id;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Employee employee = (Employee) o;
+
+ if (!id.equals(employee.id)) return false;
+ return name.equals(employee.name);
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = id.hashCode();
+ result = 31 * result + name.hashCode();
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "Employee{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
+ '}';
+ }
+}
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/iterators/Iterators.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/iterators/Iterators.java
similarity index 97%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/iterators/Iterators.java
rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/iterators/Iterators.java
index 5e7cfdb54f..23e6bbda77 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/iterators/Iterators.java
+++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/iterators/Iterators.java
@@ -1,4 +1,4 @@
-package com.baeldung.iterators;
+package com.baeldung.collections.iterators;
import java.util.ArrayList;
import java.util.Iterator;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArraySortBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/ArraySortBenchmark.java
similarity index 97%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArraySortBenchmark.java
rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/ArraySortBenchmark.java
index b93f8e9cc2..1cd56aa29d 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArraySortBenchmark.java
+++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/ArraySortBenchmark.java
@@ -1,4 +1,4 @@
-package com.baeldung.performance;
+package com.baeldung.collections.sortingcomparison;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/sort/CollectionsSortCompare.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/CollectionsSortCompare.java
similarity index 94%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/sort/CollectionsSortCompare.java
rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/CollectionsSortCompare.java
index 1eff522877..abe7a12a00 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/sort/CollectionsSortCompare.java
+++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/CollectionsSortCompare.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.sort;
+package com.baeldung.collections.sortingcomparison;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collection/ClearVsRemoveAllUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall/ClearVsRemoveAllUnitTest.java
similarity index 95%
rename from core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collection/ClearVsRemoveAllUnitTest.java
rename to core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall/ClearVsRemoveAllUnitTest.java
index 8b0a7ef0db..9cd9c6aa50 100644
--- a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collection/ClearVsRemoveAllUnitTest.java
+++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall/ClearVsRemoveAllUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.collection;
+package com.baeldung.collections.clearvsremoveall;
import org.junit.jupiter.api.Test;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java
similarity index 98%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java
rename to core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java
index 5218332d60..b00a7fd953 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java
+++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.hashmapvshashtable;
+package com.baeldung.collections.hashmapvshashtable;
import static org.junit.Assert.assertEquals;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/iterators/IteratorsUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/iterators/IteratorsUnitTest.java
similarity index 77%
rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/iterators/IteratorsUnitTest.java
rename to core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/iterators/IteratorsUnitTest.java
index 36e1f4a83c..95cf590857 100644
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/iterators/IteratorsUnitTest.java
+++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/iterators/IteratorsUnitTest.java
@@ -1,8 +1,8 @@
-package com.baeldung.iterators;
+package com.baeldung.collections.iterators;
-import static com.baeldung.iterators.Iterators.failFast1;
-import static com.baeldung.iterators.Iterators.failFast2;
-import static com.baeldung.iterators.Iterators.failSafe1;
+import static com.baeldung.collections.iterators.Iterators.failFast1;
+import static com.baeldung.collections.iterators.Iterators.failFast2;
+import static com.baeldung.collections.iterators.Iterators.failSafe1;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
diff --git a/core-java-modules/core-java-collections-list/README.md b/core-java-modules/core-java-collections-list/README.md
index e83fcce5ff..367f62780d 100644
--- a/core-java-modules/core-java-collections-list/README.md
+++ b/core-java-modules/core-java-collections-list/README.md
@@ -11,4 +11,4 @@
- [Remove the First Element from a List](http://www.baeldung.com/java-remove-first-element-from-list)
- [How to Find an Element in a List with Java](http://www.baeldung.com/find-list-element-java)
- [Finding Max/Min of a List or Collection](http://www.baeldung.com/java-collection-min-max)
-- [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list)
\ No newline at end of file
+- [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list)
diff --git a/core-java-modules/core-java-collections/README.md b/core-java-modules/core-java-collections/README.md
index b34293769d..7be7d02b3f 100644
--- a/core-java-modules/core-java-collections/README.md
+++ b/core-java-modules/core-java-collections/README.md
@@ -3,29 +3,13 @@
## Core Java Collections Cookbooks and Examples
### Relevant Articles:
-- [Java – Combine Multiple Collections](http://www.baeldung.com/java-combine-multiple-collections)
-- [Collect a Java Stream to an Immutable Collection](http://www.baeldung.com/java-stream-immutable-collection)
-- [Introduction to the Java ArrayDeque](http://www.baeldung.com/java-array-deque)
-- [Getting the Size of an Iterable in Java](http://www.baeldung.com/java-iterable-size)
-- [How to Filter a Collection in Java](http://www.baeldung.com/java-collection-filtering)
-- [Removing the First Element of an Array](https://www.baeldung.com/java-array-remove-first-element)
-- [Fail-Safe Iterator vs Fail-Fast Iterator](http://www.baeldung.com/java-fail-safe-vs-fail-fast-iterator)
-- [Shuffling Collections In Java](http://www.baeldung.com/java-shuffle-collection)
-- [An Introduction to Java.util.Hashtable Class](http://www.baeldung.com/java-hash-table)
-- [Java Null-Safe Streams from Collections](https://www.baeldung.com/java-null-safe-streams-from-collections)
+- [Collect a Java Stream to an Immutable Collection](https://www.baeldung.com/java-stream-immutable-collection)
+- [Introduction to the Java ArrayDeque](https://www.baeldung.com/java-array-deque)
+- [An Introduction to Java.util.Hashtable Class](https://www.baeldung.com/java-hash-table)
- [Thread Safe LIFO Data Structure Implementations](https://www.baeldung.com/java-lifo-thread-safe)
-- [Differences Between Collection.clear() and Collection.removeAll()](https://www.baeldung.com/java-collection-clear-vs-removeall)
-- [Performance of contains() in a HashSet vs ArrayList](https://www.baeldung.com/java-hashset-arraylist-contains-performance)
- [Time Complexity of Java Collections](https://www.baeldung.com/java-collections-complexity)
-- [Operating on and Removing an Item from Stream](https://www.baeldung.com/java-use-remove-item-stream)
-- [An Introduction to Synchronized Java Collections](https://www.baeldung.com/java-synchronized-collections)
-- [Removing Elements from Java Collections](https://www.baeldung.com/java-collection-remove-elements)
-- [Combining Different Types of Collections in Java](https://www.baeldung.com/java-combine-collections)
-- [Sorting in Java](http://www.baeldung.com/java-sorting)
-- [Join and Split Arrays and Collections in Java](http://www.baeldung.com/java-join-and-split)
- [A Guide to EnumMap](https://www.baeldung.com/java-enum-map)
-- [A Guide to Iterator in Java](http://www.baeldung.com/java-iterator)
-- [Differences Between HashMap and Hashtable](https://www.baeldung.com/hashmap-hashtable-differences)
-- [Java ArrayList vs Vector](https://www.baeldung.com/java-arraylist-vs-vector)
+- [A Guide to Iterator in Java](https://www.baeldung.com/java-iterator)
- [Defining a Char Stack in Java](https://www.baeldung.com/java-char-stack)
-- [Time Comparison of Arrays.sort(Object[]) and Arrays.sort(int[])](https://www.baeldung.com/arrays-sortobject-vs-sortint)
+- [Guide to the Java Queue Interface](https://www.baeldung.com/java-queue)
+- [An Introduction to Synchronized Java Collections](https://www.baeldung.com/java-synchronized-collections)
diff --git a/core-java-modules/core-java-collections/pom.xml b/core-java-modules/core-java-collections/pom.xml
index e5b89c3d16..7fd702845b 100644
--- a/core-java-modules/core-java-collections/pom.xml
+++ b/core-java-modules/core-java-collections/pom.xml
@@ -14,33 +14,12 @@
-
- org.apache.commons
- commons-collections4
- ${commons-collections4.version}
-
-
- org.apache.commons
- commons-lang3
- ${commons-lang3.version}
-
-
- org.eclipse.collections
- eclipse-collections
- ${eclipse.collections.version}
- org.assertjassertj-core${assertj.version}test
-
- org.junit.platform
- junit-platform-runner
- ${junit.platform.version}
- test
- org.openjdk.jmhjmh-core
@@ -51,11 +30,6 @@
jmh-generator-annprocess${openjdk.jmh.version}
-
- org.apache.commons
- commons-exec
- ${commons-exec.version}
- org.projectlomboklombok
@@ -66,13 +40,6 @@
1.19
- 1.2.0
- 3.8.1
- 4.1
- 4.01
- 1.7.03.11.1
- 7.1.0
- 1.3
diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/application/Application.java b/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/Application.java
similarity index 90%
rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/application/Application.java
rename to core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/Application.java
index 093308a34a..f974a24839 100644
--- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/application/Application.java
+++ b/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/Application.java
@@ -1,4 +1,4 @@
-package com.baeldung.synchronizedcollections.application;
+package com.baeldung.synchronizedcollections;
import java.util.Arrays;
import java.util.Collections;
diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java
deleted file mode 100644
index d0d8c3923c..0000000000
--- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.baeldung.java.collections;
-
-import org.junit.Test;
-
-import java.util.*;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import static java.util.Arrays.asList;
-import static org.junit.Assert.assertEquals;
-
-public class ConcurrentModificationExceptionUnitTest {
-
- @Test
- public void changingContentWithSetDoesNotThrowConcurrentModificationException() throws Exception {
- ArrayList
+ 4.5.91.5.0-b01
diff --git a/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java
new file mode 100644
index 0000000000..779f8aa898
--- /dev/null
+++ b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java
@@ -0,0 +1,74 @@
+package com.baeldung.url.auth;
+
+import java.io.IOException;
+import java.net.Authenticator;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.PasswordAuthentication;
+import java.net.ProtocolException;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.commons.codec.binary.Base64;
+
+public class HttpClient {
+
+ private final String user;
+ private final String password;
+
+ public HttpClient(String user, String password) {
+ this.user = user;
+ this.password = password;
+ }
+
+ public int sendRquestWithAuthHeader(String url) throws IOException {
+ HttpURLConnection connection = null;
+ try {
+ connection = createConnection(url);
+ connection.setRequestProperty("Authorization", createBasicAuthHeaderValue());
+ return connection.getResponseCode();
+ } finally {
+ if (connection != null) {
+ connection.disconnect();
+ }
+ }
+ }
+
+ public int sendRquestWithAuthenticator(String url) throws IOException {
+ setAuthenticator();
+
+ HttpURLConnection connection = null;
+ try {
+ connection = createConnection(url);
+ return connection.getResponseCode();
+ } finally {
+ if (connection != null) {
+ connection.disconnect();
+ }
+ }
+ }
+
+ private HttpURLConnection createConnection(String urlString) throws MalformedURLException, IOException, ProtocolException {
+ URL url = new URL(String.format(urlString));
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setRequestMethod("GET");
+ return connection;
+ }
+
+ private String createBasicAuthHeaderValue() {
+ String auth = user + ":" + password;
+ byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.UTF_8));
+ String authHeaderValue = "Basic " + new String(encodedAuth);
+ return authHeaderValue;
+ }
+
+ private void setAuthenticator() {
+ Authenticator.setDefault(new BasicAuthenticator());
+ }
+
+ private final class BasicAuthenticator extends Authenticator {
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(user, password.toCharArray());
+ }
+ }
+}
diff --git a/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/url/auth/HttpClientUnitTest.java b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/url/auth/HttpClientUnitTest.java
new file mode 100644
index 0000000000..0ccb6e5a54
--- /dev/null
+++ b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/url/auth/HttpClientUnitTest.java
@@ -0,0 +1,52 @@
+package com.baeldung.url.auth;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class HttpClientUnitTest {
+
+ @Test
+ public void sendRquestWithAuthHeader() throws Exception {
+ HttpClient httpClient = new HttpClient("user1", "pass1");
+
+ int status = httpClient.sendRquestWithAuthHeader("https://httpbin.org/basic-auth/user1/pass1");
+
+ assertTrue(isSuccess(status));
+ }
+
+ @Test
+ public void sendRquestWithAuthHeader_whenIncorrectCredentials_thenNotSuccessful() throws Exception {
+ HttpClient httpClient = new HttpClient("John", "Smith");
+
+ int status = httpClient.sendRquestWithAuthHeader("https://httpbin.org/basic-auth/user1/pass1");
+
+ assertTrue(isUnauthorized(status));
+ }
+
+ @Test
+ public void sendRquestWithAuthenticator() throws Exception {
+ HttpClient httpClient = new HttpClient("user2", "pass2");
+
+ int status = httpClient.sendRquestWithAuthenticator("https://httpbin.org/basic-auth/user2/pass2");
+
+ assertTrue(isSuccess(status));
+ }
+
+ @Test
+ public void sendRquestWithAuthenticator_whenIncorrectCredentials_thenNotSuccessful() throws Exception {
+ HttpClient httpClient = new HttpClient("John", "Smith");
+
+ int status = httpClient.sendRquestWithAuthenticator("https://httpbin.org/basic-auth/user2/pass2");
+
+ assertTrue(isUnauthorized(status));
+ }
+
+ private boolean isSuccess(int status) {
+ return (status >= 200) && (status < 300);
+ }
+
+ private boolean isUnauthorized(int status) {
+ return status == 401;
+ }
+}
diff --git a/core-java-modules/core-java-optional/README.md b/core-java-modules/core-java-optional/README.md
index b6848b5d33..22ac8736fa 100644
--- a/core-java-modules/core-java-optional/README.md
+++ b/core-java-modules/core-java-optional/README.md
@@ -4,3 +4,5 @@
### Relevant Articles:
- [Java Optional as Return Type](https://www.baeldung.com/java-optional-return)
+- [Guide To Java 8 Optional](https://www.baeldung.com/java-optional)
+- [Java Optional – orElse() vs orElseGet()](https://www.baeldung.com/java-optional-or-else-vs-or-else-get)
\ No newline at end of file
diff --git a/core-java-modules/core-java-optional/pom.xml b/core-java-modules/core-java-optional/pom.xml
index ca6158ef5a..d5ccd43e55 100644
--- a/core-java-modules/core-java-optional/pom.xml
+++ b/core-java-modules/core-java-optional/pom.xml
@@ -27,6 +27,21 @@
jackson-databind${jackson.version}
+
+ org.openjdk.jmh
+ jmh-core
+ ${jmh-core.version}
+
+
+ org.openjdk.jmh
+ jmh-generator-annprocess
+ ${jmh-generator.version}
+
+
+ org.openjdk.jmh
+ jmh-generator-bytecode
+ ${jmh-generator.version}
+
@@ -49,5 +64,7 @@
1.81.85.4.0.Final
+ 1.19
+ 1.19
\ No newline at end of file
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Modem.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Modem.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Modem.java
rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Modem.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java
rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java
rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Person.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Person.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Person.java
rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Person.java
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java b/core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java
rename to core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java b/core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java
rename to core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java b/core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java
rename to core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java
diff --git a/core-java-modules/core-java-security/README.md b/core-java-modules/core-java-security/README.md
index a833ca30bb..00449575b0 100644
--- a/core-java-modules/core-java-security/README.md
+++ b/core-java-modules/core-java-security/README.md
@@ -11,3 +11,4 @@
- [SHA-256 and SHA3-256 Hashing in Java](https://www.baeldung.com/sha-256-hashing-java)
- [Enabling TLS v1.2 in Java 7](https://www.baeldung.com/java-7-tls-v12)
- [The Java SecureRandom Class](https://www.baeldung.com/java-secure-random)
+- [An Introduction to Java SASL](https://www.baeldung.com/java-sasl)
diff --git a/core-java-modules/core-java-streams/README.md b/core-java-modules/core-java-streams/README.md
new file mode 100644
index 0000000000..e97641c221
--- /dev/null
+++ b/core-java-modules/core-java-streams/README.md
@@ -0,0 +1,9 @@
+=========
+
+## Core Java 8 Cookbooks and Examples
+
+### Relevant Articles:
+- [The Difference Between map() and flatMap()](https://www.baeldung.com/java-difference-map-and-flatmap)
+- [How to Use if/else Logic in Java 8 Streams](https://www.baeldung.com/java-8-streams-if-else-logic)
+- [The Difference Between Collection.stream().forEach() and Collection.forEach()](https://www.baeldung.com/java-collection-stream-foreach)
+- [Guide to Java 8’s Collectors](https://www.baeldung.com/java-8-collectors)
\ No newline at end of file
diff --git a/core-java-modules/core-java-streams/pom.xml b/core-java-modules/core-java-streams/pom.xml
new file mode 100644
index 0000000000..4ff8e8aaba
--- /dev/null
+++ b/core-java-modules/core-java-streams/pom.xml
@@ -0,0 +1,54 @@
+
+ 4.0.0
+ com.baeldung
+ core-java-streams
+ 0.1.0-SNAPSHOT
+ core-java-streams
+ jar
+
+
+ com.baeldung
+ parent-java
+ 0.0.1-SNAPSHOT
+ ../../parent-java
+
+
+
+
+ org.apache.commons
+ commons-lang3
+ ${commons-lang3.version}
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+ provided
+
+
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
+
+
+
+ core-java-streams
+
+
+ src/main/resources
+ true
+
+
+
+
+
+
+ 3.6.1
+
+ 2.22.1
+
+
diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/forEach/ReverseList.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/forEach/ReverseList.java
similarity index 100%
rename from core-java-modules/core-java-8-2/src/main/java/com/baeldung/forEach/ReverseList.java
rename to core-java-modules/core-java-streams/src/main/java/com/baeldung/forEach/ReverseList.java
diff --git a/core-java-modules/core-java-streams/src/main/resources/logback.xml b/core-java-modules/core-java-streams/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/core-java-modules/core-java-streams/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java
rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java
rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java
diff --git a/core-java-modules/core-java-text/README.md b/core-java-modules/core-java-text/README.md
new file mode 100644
index 0000000000..5a6db4e8fd
--- /dev/null
+++ b/core-java-modules/core-java-text/README.md
@@ -0,0 +1,6 @@
+=========
+
+## Core Java 8 Cookbooks and Examples
+
+### Relevant Articles:
+- [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance)
\ No newline at end of file
diff --git a/core-java-modules/core-java-text/pom.xml b/core-java-modules/core-java-text/pom.xml
new file mode 100644
index 0000000000..f831ec5f40
--- /dev/null
+++ b/core-java-modules/core-java-text/pom.xml
@@ -0,0 +1,32 @@
+
+ 4.0.0
+ com.baeldung
+ core-java-text
+ 0.1.0-SNAPSHOT
+ core-java-text
+ jar
+
+
+ com.baeldung
+ parent-java
+ 0.0.1-SNAPSHOT
+ ../../parent-java
+
+
+
+
+
+
+ core-java-text
+
+
+ src/main/resources
+ true
+
+
+
+
+
+
+
diff --git a/core-java-modules/core-java-text/src/main/resources/logback.xml b/core-java-modules/core-java-text/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/core-java-modules/core-java-text/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt
new file mode 100644
index 0000000000..6fa7983689
--- /dev/null
+++ b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt
@@ -0,0 +1,34 @@
+package com.baeldung.lists
+
+import org.junit.jupiter.api.Test
+import kotlin.test.assertEquals
+import kotlin.test.assertFalse
+import kotlin.test.assertTrue
+
+class ListsUnitTest {
+
+ var batmans: List = listOf("Christian Bale", "Michael Keaton", "Ben Affleck", "George Clooney")
+
+ @Test
+ fun whenFindASpecificItem_thenItemIsReturned() {
+ //Returns the first element matching the given predicate, or null if no such element was found.
+ val theFirstBatman = batmans.find { actor -> "Michael Keaton".equals(actor) }
+ assertEquals(theFirstBatman, "Michael Keaton")
+ }
+
+ @Test
+ fun whenFilterWithPredicate_thenMatchingItemsAreReturned() {
+ //Returns a list containing only elements matching the given predicate.
+ val theCoolestBatmans = batmans.filter { actor -> actor.contains("a") }
+ assertTrue(theCoolestBatmans.contains("Christian Bale") && theCoolestBatmans.contains("Michael Keaton"))
+ }
+
+ @Test
+ fun whenFilterNotWithPredicate_thenMatchingItemsAreReturned() {
+ //Returns a list containing only elements not matching the given predicate.
+ val theMehBatmans = batmans.filterNot { actor -> actor.contains("a") }
+ assertFalse(theMehBatmans.contains("Christian Bale") && theMehBatmans.contains("Michael Keaton"))
+ assertTrue(theMehBatmans.contains("Ben Affleck") && theMehBatmans.contains("George Clooney"))
+ }
+
+}
\ No newline at end of file
diff --git a/core-kotlin/README.md b/core-kotlin/README.md
index 3392db9171..2728fd4ea0 100644
--- a/core-kotlin/README.md
+++ b/core-kotlin/README.md
@@ -1,36 +1,36 @@
## Relevant articles:
-- [Introduction to the Kotlin Language](http://www.baeldung.com/kotlin)
-- [Guide to the “when{}” Block in Kotlin](http://www.baeldung.com/kotlin-when)
-- [Comprehensive Guide to Null Safety in Kotlin](http://www.baeldung.com/kotlin-null-safety)
-- [Kotlin Java Interoperability](http://www.baeldung.com/kotlin-java-interoperability)
-- [Difference Between “==” and “===” operators in Kotlin](http://www.baeldung.com/kotlin-equality-operators)
-- [Generics in Kotlin](http://www.baeldung.com/kotlin-generics)
-- [Introduction to Kotlin Coroutines](http://www.baeldung.com/kotlin-coroutines)
-- [Destructuring Declarations in Kotlin](http://www.baeldung.com/kotlin-destructuring-declarations)
-- [Lazy Initialization in Kotlin](http://www.baeldung.com/kotlin-lazy-initialization)
-- [Overview of Kotlin Collections API](http://www.baeldung.com/kotlin-collections-api)
-- [Converting a List to Map in Kotlin](http://www.baeldung.com/kotlin-list-to-map)
-- [Data Classes in Kotlin](http://www.baeldung.com/kotlin-data-classes)
-- [Delegated Properties in Kotlin](http://www.baeldung.com/kotlin-delegated-properties)
-- [Sealed Classes in Kotlin](http://www.baeldung.com/kotlin-sealed-classes)
-- [JUnit 5 for Kotlin Developers](http://www.baeldung.com/junit-5-kotlin)
-- [Extension Methods in Kotlin](http://www.baeldung.com/kotlin-extension-methods)
-- [Infix Functions in Kotlin](http://www.baeldung.com/kotlin-infix-functions)
-- [Try-with-resources in Kotlin](http://www.baeldung.com/kotlin-try-with-resources)
-- [Regular Expressions in Kotlin](http://www.baeldung.com/kotlin-regular-expressions)
-- [Objects in Kotlin](http://www.baeldung.com/kotlin-objects)
-- [Reading from a File in Kotlin](http://www.baeldung.com/kotlin-read-file)
-- [Guide to Kotlin @JvmField](http://www.baeldung.com/kotlin-jvm-field-annotation)
-- [Filtering Kotlin Collections](http://www.baeldung.com/kotlin-filter-collection)
-- [Writing to a File in Kotlin](http://www.baeldung.com/kotlin-write-file)
-- [Lambda Expressions in Kotlin](http://www.baeldung.com/kotlin-lambda-expressions)
-- [Kotlin String Templates](http://www.baeldung.com/kotlin-string-template)
-- [Working with Enums in Kotlin](http://www.baeldung.com/kotlin-enum)
-- [Create a Java and Kotlin Project with Maven](http://www.baeldung.com/kotlin-maven-java-project)
-- [Reflection with Kotlin](http://www.baeldung.com/kotlin-reflection)
-- [Get a Random Number in Kotlin](http://www.baeldung.com/kotlin-random-number)
-- [Idiomatic Logging in Kotlin](http://www.baeldung.com/kotlin-logging)
+- [Introduction to the Kotlin Language](https://www.baeldung.com/kotlin)
+- [Guide to the “when{}” Block in Kotlin](https://www.baeldung.com/kotlin-when)
+- [Comprehensive Guide to Null Safety in Kotlin](https://www.baeldung.com/kotlin-null-safety)
+- [Kotlin Java Interoperability](https://www.baeldung.com/kotlin-java-interoperability)
+- [Difference Between “==” and “===” operators in Kotlin](https://www.baeldung.com/kotlin-equality-operators)
+- [Generics in Kotlin](https://www.baeldung.com/kotlin-generics)
+- [Introduction to Kotlin Coroutines](https://www.baeldung.com/kotlin-coroutines)
+- [Destructuring Declarations in Kotlin](https://www.baeldung.com/kotlin-destructuring-declarations)
+- [Lazy Initialization in Kotlin](https://www.baeldung.com/kotlin-lazy-initialization)
+- [Overview of Kotlin Collections API](https://www.baeldung.com/kotlin-collections-api)
+- [Converting a List to Map in Kotlin](https://www.baeldung.com/kotlin-list-to-map)
+- [Data Classes in Kotlin](https://www.baeldung.com/kotlin-data-classes)
+- [Delegated Properties in Kotlin](https://www.baeldung.com/kotlin-delegated-properties)
+- [Sealed Classes in Kotlin](https://www.baeldung.com/kotlin-sealed-classes)
+- [JUnit 5 for Kotlin Developers](https://www.baeldung.com/junit-5-kotlin)
+- [Extension Methods in Kotlin](https://www.baeldung.com/kotlin-extension-methods)
+- [Infix Functions in Kotlin](https://www.baeldung.com/kotlin-infix-functions)
+- [Try-with-resources in Kotlin](https://www.baeldung.com/kotlin-try-with-resources)
+- [Regular Expressions in Kotlin](https://www.baeldung.com/kotlin-regular-expressions)
+- [Objects in Kotlin](https://www.baeldung.com/kotlin-objects)
+- [Reading from a File in Kotlin](https://www.baeldung.com/kotlin-read-file)
+- [Guide to Kotlin @JvmField](https://www.baeldung.com/kotlin-jvm-field-annotation)
+- [Filtering Kotlin Collections](https://www.baeldung.com/kotlin-filter-collection)
+- [Writing to a File in Kotlin](https://www.baeldung.com/kotlin-write-file)
+- [Lambda Expressions in Kotlin](https://www.baeldung.com/kotlin-lambda-expressions)
+- [Kotlin String Templates](https://www.baeldung.com/kotlin-string-template)
+- [Working with Enums in Kotlin](https://www.baeldung.com/kotlin-enum)
+- [Create a Java and Kotlin Project with Maven](https://www.baeldung.com/kotlin-maven-java-project)
+- [Reflection with Kotlin](https://www.baeldung.com/kotlin-reflection)
+- [Get a Random Number in Kotlin](https://www.baeldung.com/kotlin-random-number)
+- [Idiomatic Logging in Kotlin](https://www.baeldung.com/kotlin-logging)
- [Kotlin Constructors](https://www.baeldung.com/kotlin-constructors)
- [Creational Design Patterns in Kotlin: Builder](https://www.baeldung.com/kotlin-builder-pattern)
- [Kotlin Nested and Inner Classes](https://www.baeldung.com/kotlin-inner-classes)
diff --git a/couchbase/README.md b/couchbase/README.md
index 7a99ce4299..c4c7df97da 100644
--- a/couchbase/README.md
+++ b/couchbase/README.md
@@ -1,11 +1,11 @@
## Couchbase SDK Tutorial Project
### Relevant Articles:
-- [Introduction to Couchbase SDK for Java](http://www.baeldung.com/java-couchbase-sdk)
-- [Using Couchbase in a Spring Application](http://www.baeldung.com/couchbase-sdk-spring)
-- [Asynchronous Batch Operations in Couchbase](http://www.baeldung.com/async-batch-operations-in-couchbase)
-- [Querying Couchbase with MapReduce Views](http://www.baeldung.com/couchbase-query-mapreduce-view)
-- [Querying Couchbase with N1QL](http://www.baeldung.com/n1ql-couchbase)
+- [Introduction to Couchbase SDK for Java](https://www.baeldung.com/java-couchbase-sdk)
+- [Using Couchbase in a Spring Application](https://www.baeldung.com/couchbase-sdk-spring)
+- [Asynchronous Batch Operations in Couchbase](https://www.baeldung.com/async-batch-operations-in-couchbase)
+- [Querying Couchbase with MapReduce Views](https://www.baeldung.com/couchbase-query-mapreduce-view)
+- [Querying Couchbase with N1QL](https://www.baeldung.com/n1ql-couchbase)
### Overview
This Maven project contains the Java code for the Couchbase entities and Spring services
diff --git a/dagger/README.md b/dagger/README.md
index 72cba3d3f2..81dc161ca1 100644
--- a/dagger/README.md
+++ b/dagger/README.md
@@ -1,3 +1,3 @@
### Relevant articles:
-- [Introduction to Dagger 2](http://www.baeldung.com/dagger-2)
+- [Introduction to Dagger 2](https://www.baeldung.com/dagger-2)
diff --git a/deeplearning4j/README.md b/deeplearning4j/README.md
index 14e585cd97..eb1e19daa1 100644
--- a/deeplearning4j/README.md
+++ b/deeplearning4j/README.md
@@ -2,4 +2,4 @@
This is a sample project for the [deeplearning4j](https://deeplearning4j.org) library.
### Relevant Articles:
-- [A Guide to Deeplearning4j](http://www.baeldung.com/deeplearning4j)
+- [A Guide to Deeplearning4j](https://www.baeldung.com/deeplearning4j)
diff --git a/disruptor/README.md b/disruptor/README.md
index 779b1e89c4..8f977d090a 100644
--- a/disruptor/README.md
+++ b/disruptor/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [Concurrency with LMAX Disruptor – An Introduction](http://www.baeldung.com/lmax-disruptor-concurrency)
+- [Concurrency with LMAX Disruptor – An Introduction](https://www.baeldung.com/lmax-disruptor-concurrency)
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 0000000000..7948b3d663
--- /dev/null
+++ b/docker/README.md
@@ -0,0 +1,3 @@
+## Relevant Articles:
+
+- [Introduction to Docker Compose](https://www.baeldung.com/docker-compose)
diff --git a/dozer/README.md b/dozer/README.md
index 5e104d914c..2e610b836a 100644
--- a/dozer/README.md
+++ b/dozer/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [A Guide to Mapping With Dozer](http://www.baeldung.com/dozer)
+- [A Guide to Mapping With Dozer](https://www.baeldung.com/dozer)
diff --git a/drools/README.MD b/drools/README.MD
index 5efbe0d3c3..1ff3dfba20 100644
--- a/drools/README.MD
+++ b/drools/README.MD
@@ -1,4 +1,4 @@
### Relevant Articles:
-- [Introduction to Drools](http://www.baeldung.com/drools)
-- [Drools Using Rules from Excel Files](http://www.baeldung.com/drools-excel)
-- [An Example of Backward Chaining in Drools](http://www.baeldung.com/drools-backward-chaining)
+- [Introduction to Drools](https://www.baeldung.com/drools)
+- [Drools Using Rules from Excel Files](https://www.baeldung.com/drools-excel)
+- [An Example of Backward Chaining in Drools](https://www.baeldung.com/drools-backward-chaining)
diff --git a/dubbo/README.md b/dubbo/README.md
index 0a4cd9a204..566efe28f5 100644
--- a/dubbo/README.md
+++ b/dubbo/README.md
@@ -1,4 +1,4 @@
## Relevant articles:
-- [Introduction to Dubbo](http://www.baeldung.com/dubbo)
+- [Introduction to Dubbo](https://www.baeldung.com/dubbo)
diff --git a/ethereum/README.md b/ethereum/README.md
index d06ca09636..7eccea7135 100644
--- a/ethereum/README.md
+++ b/ethereum/README.md
@@ -1,6 +1,6 @@
## Ethereum
### Relevant Articles:
-- [Introduction to EthereumJ](http://www.baeldung.com/ethereumj)
-- [Creating and Deploying Smart Contracts with Solidity](http://www.baeldung.com/smart-contracts-ethereum-solidity)
-- [Lightweight Ethereum Clients Using Web3j](http://www.baeldung.com/web3j)
+- [Introduction to EthereumJ](https://www.baeldung.com/ethereumj)
+- [Creating and Deploying Smart Contracts with Solidity](https://www.baeldung.com/smart-contracts-ethereum-solidity)
+- [Lightweight Ethereum Clients Using Web3j](https://www.baeldung.com/web3j)
diff --git a/feign/README.md b/feign/README.md
index da04c40cdc..5aa0e3f56f 100644
--- a/feign/README.md
+++ b/feign/README.md
@@ -6,5 +6,5 @@ This is the implementation of a [spring-hypermedia-api][1] client using Feign.
### Relevant Articles:
-- [Intro to Feign](http://www.baeldung.com/intro-to-feign)
-- [Introduction to SLF4J](http://www.baeldung.com/slf4j-with-log4j2-logback)
+- [Intro to Feign](https://www.baeldung.com/intro-to-feign)
+- [Introduction to SLF4J](https://www.baeldung.com/slf4j-with-log4j2-logback)
diff --git a/geotools/README.md b/geotools/README.md
index 188ff0fddb..98f1e2c283 100644
--- a/geotools/README.md
+++ b/geotools/README.md
@@ -1,3 +1,3 @@
### Relevant Articles
-[Introduction to GeoTools](http://www.baeldung.com/geo-tools)
+[Introduction to GeoTools](https://www.baeldung.com/geo-tools)
diff --git a/google-cloud/README.md b/google-cloud/README.md
index 87ca17eac4..c6c49b88bf 100644
--- a/google-cloud/README.md
+++ b/google-cloud/README.md
@@ -1,7 +1,7 @@
## Google Cloud Tutorial Project
### Relevant Article:
-- [Intro to Google Cloud Storage With Java](http://www.baeldung.com/java-google-cloud-storage)
+- [Intro to Google Cloud Storage With Java](https://www.baeldung.com/java-google-cloud-storage)
### Overview
This Maven project contains the Java code for the article linked above.
diff --git a/google-web-toolkit/README.md b/google-web-toolkit/README.md
index 3526fe9962..d2a8b324ec 100644
--- a/google-web-toolkit/README.md
+++ b/google-web-toolkit/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Introduction to GWT](http://www.baeldung.com/gwt)
+- [Introduction to GWT](https://www.baeldung.com/gwt)
diff --git a/gradle/README.md b/gradle/README.md
index 14e460f225..0ad0ff3e45 100644
--- a/gradle/README.md
+++ b/gradle/README.md
@@ -1,6 +1,6 @@
## Relevant articles:
-- [Introduction to Gradle](http://www.baeldung.com/gradle)
-- [Writing Custom Gradle Plugins](http://www.baeldung.com/gradle-create-plugin)
-- [Creating a Fat Jar in Gradle](http://www.baeldung.com/gradle-fat-jar)
-- [A Custom Task in Gradle](http://www.baeldung.com/gradle-custom-task)
+- [Introduction to Gradle](https://www.baeldung.com/gradle)
+- [Writing Custom Gradle Plugins](https://www.baeldung.com/gradle-create-plugin)
+- [Creating a Fat Jar in Gradle](https://www.baeldung.com/gradle-fat-jar)
+- [A Custom Task in Gradle](https://www.baeldung.com/gradle-custom-task)
- [Using JUnit 5 with Gradle](https://www.baeldung.com/junit-5-gradle)
diff --git a/grails/README.md b/grails/README.md
index faa50a7efd..b93ac5de2e 100644
--- a/grails/README.md
+++ b/grails/README.md
@@ -1,3 +1,3 @@
### Relevant articles
-- [Build an MVC Web Application with Grails](http://www.baeldung.com/grails-mvc-application)
+- [Build an MVC Web Application with Grails](https://www.baeldung.com/grails-mvc-application)
diff --git a/graphql/graphql-java/README.md b/graphql/graphql-java/README.md
index 0033524209..240b62f6b4 100644
--- a/graphql/graphql-java/README.md
+++ b/graphql/graphql-java/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [Introduction to GraphQL](http://www.baeldung.com/graphql)
+- [Introduction to GraphQL](https://www.baeldung.com/graphql)
diff --git a/grpc/README.md b/grpc/README.md
index 5a60ca2e7e..17128dd19f 100644
--- a/grpc/README.md
+++ b/grpc/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Introduction to gRPC](http://www.baeldung.com/grpc-introduction)
+- [Introduction to gRPC](https://www.baeldung.com/grpc-introduction)
diff --git a/gson/README.md b/gson/README.md
index 268116a2ac..8b882f2d3e 100644
--- a/gson/README.md
+++ b/gson/README.md
@@ -4,9 +4,9 @@
### Relevant Articles:
-- [Gson Deserialization Cookbook](http://www.baeldung.com/gson-deserialization-guide)
-- [Jackson vs Gson](http://www.baeldung.com/jackson-vs-gson)
-- [Exclude Fields from Serialization in Gson](http://www.baeldung.com/gson-exclude-fields-serialization)
+- [Gson Deserialization Cookbook](https://www.baeldung.com/gson-deserialization-guide)
+- [Jackson vs Gson](https://www.baeldung.com/jackson-vs-gson)
+- [Exclude Fields from Serialization in Gson](https://www.baeldung.com/gson-exclude-fields-serialization)
- [Save Data to a JSON File with Gson](https://www.baeldung.com/gson-save-file)
- [Convert JSON to a Map Using Gson](https://www.baeldung.com/gson-json-to-map)
- [Working with Primitive Values in Gson](https://www.baeldung.com/java-gson-primitives)
diff --git a/guava-collections-set/README.md b/guava-collections-set/README.md
index c36d9e0b61..e24552aae8 100644
--- a/guava-collections-set/README.md
+++ b/guava-collections-set/README.md
@@ -2,7 +2,7 @@
## Relevant Articles:
-- [Guava – Sets](http://www.baeldung.com/guava-sets)
-- [Guide to Guava RangeSet](http://www.baeldung.com/guava-rangeset)
-- [Guava Set + Function = Map](http://www.baeldung.com/guava-set-function-map-tutorial)
+- [Guava – Sets](https://www.baeldung.com/guava-sets)
+- [Guide to Guava RangeSet](https://www.baeldung.com/guava-rangeset)
+- [Guava Set + Function = Map](https://www.baeldung.com/guava-set-function-map-tutorial)
- [Guide to Guava Multiset](https://www.baeldung.com/guava-multiset)
diff --git a/guava-collections/README.md b/guava-collections/README.md
index e919a98c2b..95397f0ff0 100644
--- a/guava-collections/README.md
+++ b/guava-collections/README.md
@@ -4,17 +4,17 @@
### Relevant Articles:
-- [Guava Collections Cookbook](http://www.baeldung.com/guava-collections)
-- [Guava Ordering Cookbook](http://www.baeldung.com/guava-order)
-- [Hamcrest Collections Cookbook](http://www.baeldung.com/hamcrest-collections-arrays)
-- [Partition a List in Java](http://www.baeldung.com/java-list-split)
-- [Filtering and Transforming Collections in Guava](http://www.baeldung.com/guava-filter-and-transform-a-collection)
-- [Guava – Join and Split Collections](http://www.baeldung.com/guava-joiner-and-splitter-tutorial)
-- [Guava – Lists](http://www.baeldung.com/guava-lists)
-- [Guava – Maps](http://www.baeldung.com/guava-maps)
-- [Guide to Guava Multimap](http://www.baeldung.com/guava-multimap)
-- [Guide to Guava RangeMap](http://www.baeldung.com/guava-rangemap)
-- [Guide to Guava MinMaxPriorityQueue and EvictingQueue](http://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue)
+- [Guava Collections Cookbook](https://www.baeldung.com/guava-collections)
+- [Guava Ordering Cookbook](https://www.baeldung.com/guava-order)
+- [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](http://www.baeldung.com/guava-table)
-- [Guide to Guava ClassToInstanceMap](http://www.baeldung.com/guava-class-to-instance-map)
\ No newline at end of file
+- [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-io/README.md b/guava-io/README.md
index df7775a36d..0737accbed 100644
--- a/guava-io/README.md
+++ b/guava-io/README.md
@@ -1,4 +1,4 @@
### Relevant Articles:
-- [Using Guava CountingOutputStream](http://www.baeldung.com/guava-counting-outputstream)
-- [Guava – Write to File, Read from File](http://www.baeldung.com/guava-write-to-file-read-from-file)
+- [Using Guava CountingOutputStream](https://www.baeldung.com/guava-counting-outputstream)
+- [Guava – Write to File, Read from File](https://www.baeldung.com/guava-write-to-file-read-from-file)
diff --git a/guava/README.md b/guava/README.md
index d3bbbf6de5..a9694daf0b 100644
--- a/guava/README.md
+++ b/guava/README.md
@@ -2,14 +2,14 @@
## Guava Examples
### Relevant Articles:
-- [Guava Functional Cookbook](http://www.baeldung.com/guava-functions-predicates)
-- [Guide to Guava’s Ordering](http://www.baeldung.com/guava-ordering)
-- [Guide to Guava’s PreConditions](http://www.baeldung.com/guava-preconditions)
-- [Introduction to Guava CacheLoader](http://www.baeldung.com/guava-cacheloader)
-- [Introduction to Guava Memoizer](http://www.baeldung.com/guava-memoizer)
-- [Guide to Guava’s EventBus](http://www.baeldung.com/guava-eventbus)
-- [Guide to Guava’s Reflection Utilities](http://www.baeldung.com/guava-reflection)
-- [Guide to Mathematical Utilities in Guava](http://www.baeldung.com/guava-math)
-- [Bloom Filter in Java using Guava](http://www.baeldung.com/guava-bloom-filter)
-- [Quick Guide to the Guava RateLimiter](http://www.baeldung.com/guava-rate-limiter)
+- [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)
+- [Guide to Guava’s EventBus](https://www.baeldung.com/guava-eventbus)
+- [Guide to Guava’s Reflection Utilities](https://www.baeldung.com/guava-reflection)
+- [Guide to Mathematical Utilities in Guava](https://www.baeldung.com/guava-math)
+- [Bloom Filter in Java using Guava](https://www.baeldung.com/guava-bloom-filter)
+- [Quick Guide to the Guava RateLimiter](https://www.baeldung.com/guava-rate-limiter)
diff --git a/guice/README.md b/guice/README.md
index 77c788c363..cc3a8755c0 100644
--- a/guice/README.md
+++ b/guice/README.md
@@ -1,5 +1,5 @@
## Google Guice Tutorials Project
### Relevant Articles
-- [Guide to Google Guice](http://www.baeldung.com/guice)
+- [Guide to Google Guice](https://www.baeldung.com/guice)
- [Guice vs Spring – Dependency Injection](https://www.baeldung.com/guice-spring-dependency-injection)
diff --git a/hazelcast/README.md b/hazelcast/README.md
index 7adb13f2af..8ba6dc122b 100644
--- a/hazelcast/README.md
+++ b/hazelcast/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [Guide to Hazelcast with Java](http://www.baeldung.com/java-hazelcast)
+- [Guide to Hazelcast with Java](https://www.baeldung.com/java-hazelcast)
- [Introduction to Hazelcast Jet](https://www.baeldung.com/hazelcast-jet)
diff --git a/httpclient-simple/README.md b/httpclient-simple/README.md
index e3535a133e..13a539d794 100644
--- a/httpclient-simple/README.md
+++ b/httpclient-simple/README.md
@@ -1,12 +1,12 @@
=========
## This module contains articles that are part of the HTTPClient Ebook
-- [HttpClient 4 – Get the Status Code](http://www.baeldung.com/httpclient-status-code)
-- [HttpClient with SSL](http://www.baeldung.com/httpclient-ssl)
-- [HttpClient Timeout](http://www.baeldung.com/httpclient-timeout)
-- [HttpClient 4 – Send Custom Cookie](http://www.baeldung.com/httpclient-4-cookies)
-- [Custom HTTP Header with the HttpClient](http://www.baeldung.com/httpclient-custom-http-header)
-- [HttpClient Basic Authentication](http://www.baeldung.com/httpclient-4-basic-authentication)
+- [HttpClient 4 – Get the Status Code](https://www.baeldung.com/httpclient-status-code)
+- [HttpClient with SSL](https://www.baeldung.com/httpclient-ssl)
+- [HttpClient Timeout](https://www.baeldung.com/httpclient-timeout)
+- [HttpClient 4 – Send Custom Cookie](https://www.baeldung.com/httpclient-4-cookies)
+- [Custom HTTP Header with the HttpClient](https://www.baeldung.com/httpclient-custom-http-header)
+- [HttpClient Basic Authentication](https://www.baeldung.com/httpclient-4-basic-authentication)
- [Posting with HttpClient](https://www.baeldung.com/httpclient-post-http-request)
diff --git a/httpclient/README.md b/httpclient/README.md
index a5fc29b089..6bce5567ec 100644
--- a/httpclient/README.md
+++ b/httpclient/README.md
@@ -7,13 +7,13 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles:
-- [HttpClient 4 – Cancel Request](http://www.baeldung.com/httpclient-cancel-request)
-- [HttpClient 4 Cookbook](http://www.baeldung.com/httpclient4)
-- [Unshorten URLs with HttpClient](http://www.baeldung.com/unshorten-url-httpclient)
-- [HttpClient 4 – Follow Redirects for POST](http://www.baeldung.com/httpclient-redirect-on-http-post)
-- [Multipart Upload with HttpClient 4](http://www.baeldung.com/httpclient-multipart-upload)
-- [HttpAsyncClient Tutorial](http://www.baeldung.com/httpasyncclient-tutorial)
-- [HttpClient 4 Tutorial](http://www.baeldung.com/httpclient-guide)
-- [Advanced HttpClient Configuration](http://www.baeldung.com/httpclient-advanced-config)
-- [HttpClient 4 – Do Not Follow Redirects](http://www.baeldung.com/httpclient-stop-follow-redirect)
-- [Custom User-Agent in HttpClient 4](http://www.baeldung.com/httpclient-user-agent-header)
+- [HttpClient 4 – Cancel Request](https://www.baeldung.com/httpclient-cancel-request)
+- [HttpClient 4 Cookbook](https://www.baeldung.com/httpclient4)
+- [Unshorten URLs with HttpClient](https://www.baeldung.com/unshorten-url-httpclient)
+- [HttpClient 4 – Follow Redirects for POST](https://www.baeldung.com/httpclient-redirect-on-http-post)
+- [Multipart Upload with HttpClient 4](https://www.baeldung.com/httpclient-multipart-upload)
+- [HttpAsyncClient Tutorial](https://www.baeldung.com/httpasyncclient-tutorial)
+- [HttpClient 4 Tutorial](https://www.baeldung.com/httpclient-guide)
+- [Advanced HttpClient Configuration](https://www.baeldung.com/httpclient-advanced-config)
+- [HttpClient 4 – Do Not Follow Redirects](https://www.baeldung.com/httpclient-stop-follow-redirect)
+- [Custom User-Agent in HttpClient 4](https://www.baeldung.com/httpclient-user-agent-header)
diff --git a/hystrix/README.md b/hystrix/README.md
index cc5c8a197f..f35518bce3 100644
--- a/hystrix/README.md
+++ b/hystrix/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [Hystrix Integration with Existing Spring Application](http://www.baeldung.com/hystrix-integration-with-spring-aop)
-- [Introduction to Hystrix](http://www.baeldung.com/introduction-to-hystrix)
+- [Hystrix Integration with Existing Spring Application](https://www.baeldung.com/hystrix-integration-with-spring-aop)
+- [Introduction to Hystrix](https://www.baeldung.com/introduction-to-hystrix)
diff --git a/image-processing/README.md b/image-processing/README.md
index 48604bdb1f..2dd74d7c47 100644
--- a/image-processing/README.md
+++ b/image-processing/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Working with Images in Java](http://www.baeldung.com/java-images)
+- [Working with Images in Java](https://www.baeldung.com/java-images)
diff --git a/immutables/README.md b/immutables/README.md
index b69a14f035..2ea4f4fe50 100644
--- a/immutables/README.md
+++ b/immutables/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Introduction to Immutables](http://www.baeldung.com/immutables)
+- [Introduction to Immutables](https://www.baeldung.com/immutables)
diff --git a/jackson-simple/README.md b/jackson-simple/README.md
index be647e22d5..79538c6929 100644
--- a/jackson-simple/README.md
+++ b/jackson-simple/README.md
@@ -5,9 +5,9 @@
The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles:
-- [Jackson Ignore Properties on Marshalling](http://www.baeldung.com/jackson-ignore-properties-on-serialization)
-- [Jackson Unmarshalling json with Unknown Properties](http://www.baeldung.com/jackson-deserialize-json-unknown-properties)
-- [Jackson Annotation Examples](http://www.baeldung.com/jackson-annotations)
-- [Intro to the Jackson ObjectMapper](http://www.baeldung.com/jackson-object-mapper-tutorial)
-- [Ignore Null Fields with Jackson](http://www.baeldung.com/jackson-ignore-null-fields)
-- [Jackson – Change Name of Field](http://www.baeldung.com/jackson-name-of-property)
+- [Jackson Ignore Properties on Marshalling](https://www.baeldung.com/jackson-ignore-properties-on-serialization)
+- [Jackson Unmarshalling json with Unknown Properties](https://www.baeldung.com/jackson-deserialize-json-unknown-properties)
+- [Jackson Annotation Examples](https://www.baeldung.com/jackson-annotations)
+- [Intro to the Jackson ObjectMapper](https://www.baeldung.com/jackson-object-mapper-tutorial)
+- [Ignore Null Fields with Jackson](https://www.baeldung.com/jackson-ignore-null-fields)
+- [Jackson – Change Name of Field](https://www.baeldung.com/jackson-name-of-property)
diff --git a/jackson/README.md b/jackson/README.md
index 01d9419a27..fb7f6c4127 100644
--- a/jackson/README.md
+++ b/jackson/README.md
@@ -6,29 +6,29 @@
The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles:
-- [Jackson – Unmarshall to Collection/Array](http://www.baeldung.com/jackson-collection-array)
-- [Jackson – Custom Serializer](http://www.baeldung.com/jackson-custom-serialization)
-- [Getting Started with Custom Deserialization in Jackson](http://www.baeldung.com/jackson-deserialization)
-- [Jackson Exceptions – Problems and Solutions](http://www.baeldung.com/jackson-exception)
-- [Jackson Date](http://www.baeldung.com/jackson-serialize-dates)
-- [Jackson – Bidirectional Relationships](http://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion)
-- [Jackson JSON Tutorial](http://www.baeldung.com/jackson)
-- [Jackson – Working with Maps and nulls](http://www.baeldung.com/jackson-map-null-values-or-null-key)
-- [Jackson – Decide What Fields Get Serialized/Deserialized](http://www.baeldung.com/jackson-field-serializable-deserializable-or-not)
-- [Jackson vs Gson](http://www.baeldung.com/jackson-vs-gson)
-- [XML Serialization and Deserialization with Jackson](http://www.baeldung.com/jackson-xml-serialization-and-deserialization)
-- [More Jackson Annotations](http://www.baeldung.com/jackson-advanced-annotations)
-- [Inheritance with Jackson](http://www.baeldung.com/jackson-inheritance)
-- [Guide to @JsonFormat in Jackson](http://www.baeldung.com/jackson-jsonformat)
-- [Using Optional with Jackson](http://www.baeldung.com/jackson-optional)
-- [Map Serialization and Deserialization with Jackson](http://www.baeldung.com/jackson-map)
-- [Jackson Streaming API](http://www.baeldung.com/jackson-streaming-api)
-- [Jackson – JsonMappingException (No serializer found for class)](http://www.baeldung.com/jackson-jsonmappingexception)
-- [How To Serialize Enums as JSON Objects with Jackson](http://www.baeldung.com/jackson-serialize-enums)
-- [Jackson – Marshall String to JsonNode](http://www.baeldung.com/jackson-json-to-jsonnode)
-- [Jackson – Unmarshall to Collection/Array](http://www.baeldung.com/jackson-collection-array)
-- [Serialize Only Fields that meet a Custom Criteria with Jackson](http://www.baeldung.com/jackson-serialize-field-custom-criteria)
-- [Mapping Nested Values with Jackson](http://www.baeldung.com/jackson-nested-values)
+- [Jackson – Unmarshall to Collection/Array](https://www.baeldung.com/jackson-collection-array)
+- [Jackson – Custom Serializer](https://www.baeldung.com/jackson-custom-serialization)
+- [Getting Started with Custom Deserialization in Jackson](https://www.baeldung.com/jackson-deserialization)
+- [Jackson Exceptions – Problems and Solutions](https://www.baeldung.com/jackson-exception)
+- [Jackson Date](https://www.baeldung.com/jackson-serialize-dates)
+- [Jackson – Bidirectional Relationships](https://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion)
+- [Jackson JSON Tutorial](https://www.baeldung.com/jackson)
+- [Jackson – Working with Maps and nulls](https://www.baeldung.com/jackson-map-null-values-or-null-key)
+- [Jackson – Decide What Fields Get Serialized/Deserialized](https://www.baeldung.com/jackson-field-serializable-deserializable-or-not)
+- [Jackson vs Gson](https://www.baeldung.com/jackson-vs-gson)
+- [XML Serialization and Deserialization with Jackson](https://www.baeldung.com/jackson-xml-serialization-and-deserialization)
+- [More Jackson Annotations](https://www.baeldung.com/jackson-advanced-annotations)
+- [Inheritance with Jackson](https://www.baeldung.com/jackson-inheritance)
+- [Guide to @JsonFormat in Jackson](https://www.baeldung.com/jackson-jsonformat)
+- [Using Optional with Jackson](https://www.baeldung.com/jackson-optional)
+- [Map Serialization and Deserialization with Jackson](https://www.baeldung.com/jackson-map)
+- [Jackson Streaming API](https://www.baeldung.com/jackson-streaming-api)
+- [Jackson – JsonMappingException (No serializer found for class)](https://www.baeldung.com/jackson-jsonmappingexception)
+- [How To Serialize Enums as JSON Objects with Jackson](https://www.baeldung.com/jackson-serialize-enums)
+- [Jackson – Marshall String to JsonNode](https://www.baeldung.com/jackson-json-to-jsonnode)
+- [Jackson – Unmarshall to Collection/Array](https://www.baeldung.com/jackson-collection-array)
+- [Serialize Only Fields that meet a Custom Criteria with Jackson](https://www.baeldung.com/jackson-serialize-field-custom-criteria)
+- [Mapping Nested Values with Jackson](https://www.baeldung.com/jackson-nested-values)
- [Convert XML to JSON Using Jackson](https://www.baeldung.com/jackson-convert-xml-json)
- [Deserialize Immutable Objects with Jackson](https://www.baeldung.com/jackson-deserialize-immutable-objects)
- [Mapping a Dynamic JSON Object with Jackson](https://www.baeldung.com/jackson-mapping-dynamic-object)
diff --git a/java-blockchain/README.md b/java-blockchain/README.md
index 600f4dd610..5afd0d356b 100644
--- a/java-blockchain/README.md
+++ b/java-blockchain/README.md
@@ -1,6 +1,7 @@
-=========
+## Java Blockchain
-## Basic Implementation of Blockchian in Java
+This module contains articles about Blockchain in Java
### Relevant Articles:
-- []()
+
+- [Implementing a Simple Blockchain in Java](https://www.baeldung.com/java-blockchain)
diff --git a/java-collections-conversions/README.md b/java-collections-conversions/README.md
index 614f20f186..e80f29f519 100644
--- a/java-collections-conversions/README.md
+++ b/java-collections-conversions/README.md
@@ -3,12 +3,12 @@
## Java Collections Cookbooks and Examples
### Relevant Articles:
-- [Converting between an Array and a List in Java](http://www.baeldung.com/convert-array-to-list-and-list-to-array)
-- [Converting between an Array and a Set in Java](http://www.baeldung.com/convert-array-to-set-and-set-to-array)
-- [Converting between a List and a Set in Java](http://www.baeldung.com/convert-list-to-set-and-set-to-list)
-- [Convert a Map to an Array, List or Set in Java](http://www.baeldung.com/convert-map-values-to-array-list-set)
-- [Converting a List to String in Java](http://www.baeldung.com/java-list-to-string)
-- [How to Convert List to Map in Java](http://www.baeldung.com/java-list-to-map)
+- [Converting between an Array and a List in Java](https://www.baeldung.com/convert-array-to-list-and-list-to-array)
+- [Converting between an Array and a Set in Java](https://www.baeldung.com/convert-array-to-set-and-set-to-array)
+- [Converting between a List and a Set in Java](https://www.baeldung.com/convert-list-to-set-and-set-to-list)
+- [Convert a Map to an Array, List or Set in Java](https://www.baeldung.com/convert-map-values-to-array-list-set)
+- [Converting a List to String in Java](https://www.baeldung.com/java-list-to-string)
+- [How to Convert List to Map in Java](https://www.baeldung.com/java-list-to-map)
- [Array to String Conversions](https://www.baeldung.com/java-array-to-string)
- [Converting a Collection to ArrayList in Java](https://www.baeldung.com/java-convert-collection-arraylist)
- [Java 8 Collectors toMap](https://www.baeldung.com/java-collectors-tomap)
diff --git a/java-collections-maps-2/README.md b/java-collections-maps-2/README.md
index ff84e93ce4..09c4b4fbb3 100644
--- a/java-collections-maps-2/README.md
+++ b/java-collections-maps-2/README.md
@@ -1,3 +1,12 @@
## Relevant Articles:
- [Map of Primitives in Java](https://www.baeldung.com/java-map-primitives)
- [Copying a HashMap in Java](https://www.baeldung.com/java-copy-hashmap)
+- [Guide to Java HashMap]()
+- [Guide to WeakHashMap in Java](https://www.baeldung.com/java-weakhashmap)
+- [Map to String Conversion in Java](https://www.baeldung.com/java-map-to-string-conversion)
+- [Iterate over a Map in Java](https://www.baeldung.com/java-iterate-map)
+- [Merging Two Maps with Java 8](https://www.baeldung.com/java-merge-maps)
+- [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort)
+- [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max)
+- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap)
+- [Java TreeMap vs HashMap](https://www.baeldung.com/java-treemap-vs-hashmap)
diff --git a/java-collections-maps-2/pom.xml b/java-collections-maps-2/pom.xml
index e242a8655e..a246559f61 100644
--- a/java-collections-maps-2/pom.xml
+++ b/java-collections-maps-2/pom.xml
@@ -41,6 +41,22 @@
commons-lang3${commons-lang3.version}
+
+ org.apache.commons
+ commons-collections4
+ ${commons-collections4.version}
+
+
+ one.util
+ streamex
+ ${streamex.version}
+
+
+ com.jayway.awaitility
+ awaitility
+ ${avaitility.version}
+ test
+ org.assertjassertj-core
@@ -50,6 +66,9 @@
+ 0.6.5
+ 4.1
+ 1.7.08.2.03.0.28.1.0
diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/Product.java b/java-collections-maps-2/src/main/java/com/baeldung/map/Product.java
new file mode 100644
index 0000000000..5559895730
--- /dev/null
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/Product.java
@@ -0,0 +1,133 @@
+package com.baeldung.map;
+
+import java.util.*;
+
+public class Product {
+
+ private String name;
+ private String description;
+ private List tags;
+
+ public Product(String name, String description) {
+ this.name = name;
+ this.description = description;
+ this.tags = new ArrayList<>();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public List getTags() {
+ return tags;
+ }
+
+ public Product addTagsOfOtherProdcut(Product product) {
+ this.tags.addAll(product.getTags());
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ Product product = (Product) o;
+ return Objects.equals(name, product.name) &&
+ Objects.equals(description, product.description);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, description);
+ }
+
+ public static void forEach() {
+
+ HashMap productsByName = new HashMap<>();
+ productsByName.forEach( (key, product)
+ -> System.out.println("Key: " + key + " Product:" + product.getDescription())
+ //do something with the key and value
+ );
+
+ //Prior to Java 8:
+ for(Map.Entry entry : productsByName.entrySet()) {
+ Product product = entry.getValue();
+ String key = entry.getKey();
+ //do something with the key and value
+ }
+ }
+
+ public static void getOrDefault() {
+
+ HashMap productsByName = new HashMap<>();
+ Product chocolate = new Product("chocolate", "something sweet");
+ Product defaultProduct = productsByName.getOrDefault("horse carriage", chocolate);
+ Product bike = productsByName.getOrDefault("E-Bike", chocolate);
+
+ //Prior to Java 8:
+ Product bike2 = productsByName.containsKey("E-Bike")
+ ? productsByName.get("E-Bike")
+ : chocolate;
+ Product defaultProduct2 = productsByName.containsKey("horse carriage")
+ ? productsByName.get("horse carriage")
+ : chocolate;
+ }
+
+ public static void putIfAbsent() {
+
+ HashMap productsByName = new HashMap<>();
+ Product chocolate = new Product("chocolate", "something sweet");
+ productsByName.putIfAbsent("E-Bike", chocolate);
+
+ //Prior to Java 8:
+ if(productsByName.containsKey("E-Bike")) {
+ productsByName.put("E-Bike", chocolate);
+ }
+ }
+
+ public static void merge() {
+
+ HashMap productsByName = new HashMap<>();
+ Product eBike2 = new Product("E-Bike", "A bike with a battery");
+ eBike2.getTags().add("sport");
+ productsByName.merge("E-Bike", eBike2, Product::addTagsOfOtherProdcut);
+
+ //Prior to Java 8:
+ if(productsByName.containsKey("E-Bike")) {
+ productsByName.get("E-Bike").addTagsOfOtherProdcut(eBike2);
+ } else {
+ productsByName.put("E-Bike", eBike2);
+ }
+ }
+
+ public static void compute() {
+
+ HashMap productsByName = new HashMap<>();
+ Product eBike2 = new Product("E-Bike", "A bike with a battery");
+
+ productsByName.compute("E-Bike", (k,v) -> {
+ if(v != null) {
+ return v.addTagsOfOtherProdcut(eBike2);
+ } else {
+ return eBike2;
+ }
+ });
+
+ //Prior to Java 8:
+ if(productsByName.containsKey("E-Bike")) {
+ productsByName.get("E-Bike").addTagsOfOtherProdcut(eBike2);
+ } else {
+ productsByName.put("E-Bike", eBike2);
+ }
+ }
+}
diff --git a/java-collections-maps/src/main/java/com/baeldung/convert/MapToString.java b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/MapToString.java
similarity index 96%
rename from java-collections-maps/src/main/java/com/baeldung/convert/MapToString.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/convert/MapToString.java
index aca0d05ef1..d13be924ff 100644
--- a/java-collections-maps/src/main/java/com/baeldung/convert/MapToString.java
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/MapToString.java
@@ -1,4 +1,4 @@
-package com.baeldung.convert;
+package com.baeldung.map.convert;
import com.google.common.base.Joiner;
import org.apache.commons.lang3.StringUtils;
diff --git a/java-collections-maps/src/main/java/com/baeldung/convert/StringToMap.java b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/StringToMap.java
similarity index 94%
rename from java-collections-maps/src/main/java/com/baeldung/convert/StringToMap.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/convert/StringToMap.java
index caabca4a09..416ba4dd9a 100644
--- a/java-collections-maps/src/main/java/com/baeldung/convert/StringToMap.java
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/StringToMap.java
@@ -1,4 +1,4 @@
-package com.baeldung.convert;
+package com.baeldung.map.convert;
import com.google.common.base.Splitter;
diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/CopyHashMap.java b/java-collections-maps-2/src/main/java/com/baeldung/map/copyhashmap/CopyHashMap.java
similarity index 98%
rename from java-collections-maps-2/src/main/java/com/baeldung/map/CopyHashMap.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/copyhashmap/CopyHashMap.java
index 2ebc9413c8..cb18f3aa11 100644
--- a/java-collections-maps-2/src/main/java/com/baeldung/map/CopyHashMap.java
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/copyhashmap/CopyHashMap.java
@@ -1,4 +1,6 @@
-package com.baeldung.map;
+package com.baeldung.map.copyhashmap;
+
+import org.apache.commons.lang3.SerializationUtils;
import java.util.HashMap;
import java.util.Map;
@@ -6,8 +8,6 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;
-import org.apache.commons.lang3.SerializationUtils;
-
public class CopyHashMap {
public static HashMap copyUsingConstructor(HashMap originalMap) {
diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/initialize/MapInitializer.java b/java-collections-maps-2/src/main/java/com/baeldung/map/initialize/MapInitializer.java
similarity index 98%
rename from java-collections-maps/src/main/java/com/baeldung/java/map/initialize/MapInitializer.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/initialize/MapInitializer.java
index 4dbaceac62..4d63abcfd0 100644
--- a/java-collections-maps/src/main/java/com/baeldung/java/map/initialize/MapInitializer.java
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/initialize/MapInitializer.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.map.initialize;
+package com.baeldung.map.initialize;
import java.util.AbstractMap;
import java.util.Collections;
diff --git a/java-collections-maps/src/main/java/com/baeldung/map/iteration/MapIteration.java b/java-collections-maps-2/src/main/java/com/baeldung/map/iteration/MapIteration.java
similarity index 100%
rename from java-collections-maps/src/main/java/com/baeldung/map/iteration/MapIteration.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/iteration/MapIteration.java
diff --git a/java-collections-maps/src/main/java/com/baeldung/map/util/MapMax.java b/java-collections-maps-2/src/main/java/com/baeldung/map/mapmax/MapMax.java
similarity index 94%
rename from java-collections-maps/src/main/java/com/baeldung/map/util/MapMax.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/mapmax/MapMax.java
index 93a98ba6fd..8c33c857ee 100644
--- a/java-collections-maps/src/main/java/com/baeldung/map/util/MapMax.java
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/mapmax/MapMax.java
@@ -1,11 +1,7 @@
-package com.baeldung.map.util;
+package com.baeldung.map.mapmax;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
import java.util.Map.Entry;
-import java.util.Optional;
public class MapMax {
diff --git a/java-collections-maps/src/main/java/com/baeldung/sort/Employee.java b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/Employee.java
similarity index 97%
rename from java-collections-maps/src/main/java/com/baeldung/sort/Employee.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/Employee.java
index b5e56f6141..d7fb0d1a1d 100644
--- a/java-collections-maps/src/main/java/com/baeldung/sort/Employee.java
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/Employee.java
@@ -1,4 +1,4 @@
-package com.baeldung.sort;
+package com.baeldung.map.mergemaps;
public class Employee implements Comparable {
diff --git a/java-collections-maps/src/main/java/com/baeldung/map/java_8/MergeMaps.java b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/MergeMaps.java
similarity index 97%
rename from java-collections-maps/src/main/java/com/baeldung/map/java_8/MergeMaps.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/MergeMaps.java
index 052cfb8bad..4f187bad90 100644
--- a/java-collections-maps/src/main/java/com/baeldung/map/java_8/MergeMaps.java
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/MergeMaps.java
@@ -1,7 +1,7 @@
-package com.baeldung.map.java_8;
+package com.baeldung.map.mergemaps;
-import com.baeldung.sort.Employee;
import one.util.streamex.EntryStream;
+
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/PrimitiveMaps.java b/java-collections-maps-2/src/main/java/com/baeldung/map/primitives/PrimitiveMaps.java
similarity index 98%
rename from java-collections-maps-2/src/main/java/com/baeldung/map/PrimitiveMaps.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/primitives/PrimitiveMaps.java
index d835950c68..30bec12ccc 100644
--- a/java-collections-maps-2/src/main/java/com/baeldung/map/PrimitiveMaps.java
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/primitives/PrimitiveMaps.java
@@ -1,4 +1,4 @@
-package com.baeldung.map;
+package com.baeldung.map.primitives;
import cern.colt.map.AbstractIntDoubleMap;
import cern.colt.map.OpenIntDoubleHashMap;
diff --git a/java-collections-maps/src/main/java/com/baeldung/sort/SortHashMap.java b/java-collections-maps-2/src/main/java/com/baeldung/map/sort/SortHashMap.java
similarity index 97%
rename from java-collections-maps/src/main/java/com/baeldung/sort/SortHashMap.java
rename to java-collections-maps-2/src/main/java/com/baeldung/map/sort/SortHashMap.java
index b8a2b32060..14610ffb00 100644
--- a/java-collections-maps/src/main/java/com/baeldung/sort/SortHashMap.java
+++ b/java-collections-maps-2/src/main/java/com/baeldung/map/sort/SortHashMap.java
@@ -1,8 +1,8 @@
-package com.baeldung.sort;
+package com.baeldung.map.sort;
+import com.baeldung.map.mergemaps.Employee;
import com.google.common.base.Functions;
import com.google.common.collect.ImmutableSortedMap;
-import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
import java.util.*;
diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java
new file mode 100644
index 0000000000..2015909870
--- /dev/null
+++ b/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java
@@ -0,0 +1,124 @@
+package com.baeldung.map;
+
+import org.junit.jupiter.api.Test;
+
+import java.util.HashMap;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+class ProductUnitTest {
+
+
+ @Test
+ public void getExistingValue() {
+ HashMap productsByName = new HashMap<>();
+
+ Product eBike = new Product("E-Bike", "A bike with a battery");
+ Product roadBike = new Product("Road bike", "A bike for competition");
+
+ productsByName.put(eBike.getName(), eBike);
+ productsByName.put(roadBike.getName(), roadBike);
+
+ Product nextPurchase = productsByName.get("E-Bike");
+
+ assertEquals("A bike with a battery", nextPurchase.getDescription());
+ }
+
+ @Test
+ public void getNonExistingValue() {
+ HashMap productsByName = new HashMap<>();
+
+ Product eBike = new Product("E-Bike", "A bike with a battery");
+ Product roadBike = new Product("Road bike", "A bike for competition");
+
+ productsByName.put(eBike.getName(), eBike);
+ productsByName.put(roadBike.getName(), roadBike);
+
+ Product nextPurchase = productsByName.get("Car");
+
+ assertNull(nextPurchase);
+ }
+
+ @Test
+ public void getExistingValueAfterSameKeyInsertedTwice() {
+ HashMap productsByName = new HashMap<>();
+
+ Product eBike = new Product("E-Bike", "A bike with a battery");
+ Product roadBike = new Product("Road bike", "A bike for competition");
+ Product newEBike = new Product("E-Bike", "A bike with a better battery");
+
+ productsByName.put(eBike.getName(), eBike);
+ productsByName.put(roadBike.getName(), roadBike);
+ productsByName.put(newEBike.getName(), newEBike);
+
+ Product nextPurchase = productsByName.get("E-Bike");
+
+ assertEquals("A bike with a better battery", nextPurchase.getDescription());
+ }
+
+ @Test
+ public void getExistingValueWithNullKey() {
+ HashMap productsByName = new HashMap<>();
+
+ Product defaultProduct = new Product("Chocolate", "At least buy chocolate");
+
+ productsByName.put(null, defaultProduct);
+ productsByName.put(defaultProduct.getName(), defaultProduct);
+
+ Product nextPurchase = productsByName.get(null);
+ assertEquals("At least buy chocolate", nextPurchase.getDescription());
+
+ nextPurchase = productsByName.get("Chocolate");
+ assertEquals("At least buy chocolate", nextPurchase.getDescription());
+ }
+
+ @Test
+ public void insertSameObjectWithDifferentKey() {
+ HashMap productsByName = new HashMap<>();
+
+ Product defaultProduct = new Product("Chocolate", "At least buy chocolate");
+
+ productsByName.put(null, defaultProduct);
+ productsByName.put(defaultProduct.getName(), defaultProduct);
+
+ assertSame(productsByName.get(null), productsByName.get("Chocolate"));
+ }
+
+ @Test
+ public void checkIfKeyExists() {
+ HashMap productsByName = new HashMap<>();
+
+ Product eBike = new Product("E-Bike", "A bike with a battery");
+
+ productsByName.put(eBike.getName(), eBike);
+
+ assertTrue(productsByName.containsKey("E-Bike"));
+ }
+
+ @Test
+ public void checkIfValueExists() {
+ HashMap productsByName = new HashMap<>();
+
+ Product eBike = new Product("E-Bike", "A bike with a battery");
+
+ productsByName.put(eBike.getName(), eBike);
+
+ assertTrue(productsByName.containsValue(eBike));
+ }
+
+ @Test
+ public void removeExistingKey() {
+ HashMap productsByName = new HashMap<>();
+
+ Product eBike = new Product("E-Bike", "A bike with a battery");
+ Product roadBike = new Product("Road bike", "A bike for competition");
+
+ productsByName.put(eBike.getName(), eBike);
+ productsByName.put(roadBike.getName(), roadBike);
+
+ productsByName.remove("E-Bike");
+
+ assertNull(productsByName.get("E-Bike"));
+ }
+
+}
diff --git a/java-collections-maps/src/test/java/com/baeldung/convert/MapToStringUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/MapToStringUnitTest.java
similarity index 97%
rename from java-collections-maps/src/test/java/com/baeldung/convert/MapToStringUnitTest.java
rename to java-collections-maps-2/src/test/java/com/baeldung/map/convert/MapToStringUnitTest.java
index d9923e74a0..4517dea328 100644
--- a/java-collections-maps/src/test/java/com/baeldung/convert/MapToStringUnitTest.java
+++ b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/MapToStringUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.convert;
+package com.baeldung.map.convert;
import org.apache.commons.collections4.MapUtils;
import org.junit.Assert;
diff --git a/java-collections-maps/src/test/java/com/baeldung/convert/StringToMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/StringToMapUnitTest.java
similarity index 95%
rename from java-collections-maps/src/test/java/com/baeldung/convert/StringToMapUnitTest.java
rename to java-collections-maps-2/src/test/java/com/baeldung/map/convert/StringToMapUnitTest.java
index 8fb906efd0..2f80b30871 100644
--- a/java-collections-maps/src/test/java/com/baeldung/convert/StringToMapUnitTest.java
+++ b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/StringToMapUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.convert;
+package com.baeldung.map.convert;
import org.junit.Assert;
import org.junit.jupiter.api.Test;
diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/CopyHashMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/CopyHashMapUnitTest.java
similarity index 98%
rename from java-collections-maps-2/src/test/java/com/baeldung/map/CopyHashMapUnitTest.java
rename to java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/CopyHashMapUnitTest.java
index c400eea153..e2d5e327e1 100644
--- a/java-collections-maps-2/src/test/java/com/baeldung/map/CopyHashMapUnitTest.java
+++ b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/CopyHashMapUnitTest.java
@@ -1,13 +1,12 @@
-package com.baeldung.map;
+package com.baeldung.map.copyhashmap;
-import static org.assertj.core.api.Assertions.assertThat;
+import com.google.common.collect.ImmutableMap;
+import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Test;
-
-import com.google.common.collect.ImmutableMap;
+import static org.assertj.core.api.Assertions.assertThat;
public class CopyHashMapUnitTest {
diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/Employee.java b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/Employee.java
similarity index 91%
rename from java-collections-maps-2/src/test/java/com/baeldung/map/Employee.java
rename to java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/Employee.java
index 7963fa811c..5db55c26ea 100644
--- a/java-collections-maps-2/src/test/java/com/baeldung/map/Employee.java
+++ b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/Employee.java
@@ -1,4 +1,4 @@
-package com.baeldung.map;
+package com.baeldung.map.copyhashmap;
import java.io.Serializable;
diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/initialize/MapInitializerUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/initialize/MapInitializerUnitTest.java
similarity index 94%
rename from java-collections-maps/src/test/java/com/baeldung/java/map/initialize/MapInitializerUnitTest.java
rename to java-collections-maps-2/src/test/java/com/baeldung/map/initialize/MapInitializerUnitTest.java
index 80a8983d6f..7c6dffe787 100644
--- a/java-collections-maps/src/test/java/com/baeldung/java/map/initialize/MapInitializerUnitTest.java
+++ b/java-collections-maps-2/src/test/java/com/baeldung/map/initialize/MapInitializerUnitTest.java
@@ -1,10 +1,10 @@
-package com.baeldung.java.map.initialize;
+package com.baeldung.map.initialize;
-import static org.junit.Assert.assertEquals;
+import org.junit.Test;
import java.util.Map;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
public class MapInitializerUnitTest {
diff --git a/java-collections-maps/src/test/java/com/baeldung/map/util/MapMaxUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/mapmax/MapMaxUnitTest.java
similarity index 97%
rename from java-collections-maps/src/test/java/com/baeldung/map/util/MapMaxUnitTest.java
rename to java-collections-maps-2/src/test/java/com/baeldung/map/mapmax/MapMaxUnitTest.java
index 883265cc8b..30b945bfc8 100644
--- a/java-collections-maps/src/test/java/com/baeldung/map/util/MapMaxUnitTest.java
+++ b/java-collections-maps-2/src/test/java/com/baeldung/map/mapmax/MapMaxUnitTest.java
@@ -1,14 +1,13 @@
-package com.baeldung.map.util;
+package com.baeldung.map.mapmax;
-
-import static org.junit.Assert.assertEquals;
+import org.junit.Before;
+import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
public class MapMaxUnitTest {
diff --git a/java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java b/java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java
similarity index 91%
rename from java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java
rename to java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java
index f2dfc992c2..1057e3b9f0 100644
--- a/java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java
+++ b/java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java
@@ -1,16 +1,14 @@
-package com.baeldung.collection;
-
-import java.util.ConcurrentModificationException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
+package com.baeldung.map.treemaphashmap;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Test;
-public class WhenComparingTreeMapVsHashMap {
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+public class TreeMapVsHashMapUnitTest {
@Test
public void whenInsertObjectsTreeMap_thenNaturalOrder() {
diff --git a/java-collections-maps/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/weakhashmap/WeakHashMapUnitTest.java
similarity index 98%
rename from java-collections-maps/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java
rename to java-collections-maps-2/src/test/java/com/baeldung/map/weakhashmap/WeakHashMapUnitTest.java
index d7bcb31867..293f24c378 100644
--- a/java-collections-maps/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java
+++ b/java-collections-maps-2/src/test/java/com/baeldung/map/weakhashmap/WeakHashMapUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.weakhashmap;
+package com.baeldung.map.weakhashmap;
import org.junit.Test;
diff --git a/java-collections-maps/README.md b/java-collections-maps/README.md
index 2eeb2c8843..3a6ad1d10c 100644
--- a/java-collections-maps/README.md
+++ b/java-collections-maps/README.md
@@ -3,21 +3,13 @@
## Java Collections Cookbooks and Examples
### Relevant Articles:
-- [Guide to WeakHashMap in Java](http://www.baeldung.com/java-weakhashmap)
-- [Guide to the Guava BiMap](http://www.baeldung.com/guava-bimap)
-- [The Java HashMap Under the Hood](http://www.baeldung.com/java-hashmap)
-- [A Guide to LinkedHashMap in Java](http://www.baeldung.com/java-linked-hashmap)
-- [A Guide to TreeMap in Java](http://www.baeldung.com/java-treemap)
-- [Iterate over a Map in Java](http://www.baeldung.com/java-iterate-map)
-- [Java TreeMap vs HashMap](http://www.baeldung.com/java-treemap-vs-hashmap)
-- [How to Store Duplicate Keys in a Map in Java?](http://www.baeldung.com/java-map-duplicate-keys)
-- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap)
+- [Guide to the Guava BiMap](https://www.baeldung.com/guava-bimap)
+- [The Java HashMap Under the Hood](https://www.baeldung.com/java-hashmap)
+- [A Guide to LinkedHashMap in Java](https://www.baeldung.com/java-linked-hashmap)
+- [A Guide to TreeMap in Java](https://www.baeldung.com/java-treemap)
+- [How to Store Duplicate Keys in a Map in Java?](https://www.baeldung.com/java-map-duplicate-keys)
- [Get the Key for a Value from a Java Map](https://www.baeldung.com/java-map-key-from-value)
-- [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort)
-- [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max)
-- [Merging Two Maps with Java 8](https://www.baeldung.com/java-merge-maps)
- [How to Check If a Key Exists in a Map](https://www.baeldung.com/java-map-key-exists)
- [Comparing Two HashMaps in Java](https://www.baeldung.com/java-compare-hashmaps)
- [Immutable Map Implementations in Java](https://www.baeldung.com/java-immutable-maps)
-- [Map to String Conversion in Java](https://www.baeldung.com/java-map-to-string-conversion)
- [Guide to Apache Commons MultiValuedMap](https://www.baeldung.com/apache-commons-multi-valued-map)
diff --git a/java-collections-maps/pom.xml b/java-collections-maps/pom.xml
index 83cc97a21e..b755582580 100644
--- a/java-collections-maps/pom.xml
+++ b/java-collections-maps/pom.xml
@@ -36,11 +36,6 @@
${assertj.version}test
-
- one.util
- streamex
- ${streamex.version}
-
@@ -49,6 +44,5 @@
1.7.03.6.17.1.0
- 0.6.5
diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/MapUtil.java b/java-collections-maps/src/main/java/com/baeldung/map/MapUtil.java
similarity index 96%
rename from java-collections-maps/src/main/java/com/baeldung/java/map/MapUtil.java
rename to java-collections-maps/src/main/java/com/baeldung/map/MapUtil.java
index 688c7592f3..91b7197a92 100644
--- a/java-collections-maps/src/main/java/com/baeldung/java/map/MapUtil.java
+++ b/java-collections-maps/src/main/java/com/baeldung/map/MapUtil.java
@@ -1,12 +1,12 @@
/**
*
*/
-package com.baeldung.java.map;
+package com.baeldung.map;
import java.util.HashSet;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import java.util.stream.Stream;
/**
diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/MyKey.java b/java-collections-maps/src/main/java/com/baeldung/map/MyKey.java
similarity index 97%
rename from java-collections-maps/src/main/java/com/baeldung/java/map/MyKey.java
rename to java-collections-maps/src/main/java/com/baeldung/map/MyKey.java
index ae3c3edc39..9993d7862c 100644
--- a/java-collections-maps/src/main/java/com/baeldung/java/map/MyKey.java
+++ b/java-collections-maps/src/main/java/com/baeldung/map/MyKey.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.map;
+package com.baeldung.map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java b/java-collections-maps/src/main/java/com/baeldung/map/MyLinkedHashMap.java
similarity index 94%
rename from java-collections-maps/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java
rename to java-collections-maps/src/main/java/com/baeldung/map/MyLinkedHashMap.java
index 1e237580ec..b687e57d85 100644
--- a/java-collections-maps/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java
+++ b/java-collections-maps/src/main/java/com/baeldung/map/MyLinkedHashMap.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.map;
+package com.baeldung.map;
import java.util.LinkedHashMap;
import java.util.Map;
diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/ImmutableMapUnitTest.java
similarity index 92%
rename from java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java
rename to java-collections-maps/src/test/java/com/baeldung/map/ImmutableMapUnitTest.java
index b239ae07d8..d308aac7eb 100644
--- a/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java
+++ b/java-collections-maps/src/test/java/com/baeldung/map/ImmutableMapUnitTest.java
@@ -1,16 +1,13 @@
-package com.baeldung.java.map;
+package com.baeldung.map;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import com.google.common.collect.ImmutableMap;
+import org.junit.jupiter.api.Test;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import org.junit.jupiter.api.Test;
-
-import com.google.common.collect.ImmutableMap;
+import static org.junit.jupiter.api.Assertions.*;
public class ImmutableMapUnitTest {
diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/KeyCheckUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/KeyCheckUnitTest.java
similarity index 78%
rename from java-collections-maps/src/test/java/com/baeldung/java/map/KeyCheckUnitTest.java
rename to java-collections-maps/src/test/java/com/baeldung/map/KeyCheckUnitTest.java
index 2c97a97690..dbad2e5b5e 100644
--- a/java-collections-maps/src/test/java/com/baeldung/java/map/KeyCheckUnitTest.java
+++ b/java-collections-maps/src/test/java/com/baeldung/map/KeyCheckUnitTest.java
@@ -1,13 +1,11 @@
-package com.baeldung.java.map;
+package com.baeldung.map;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import org.junit.Test;
import java.util.Collections;
import java.util.Map;
-import org.junit.Test;
+import static org.junit.Assert.*;
public class KeyCheckUnitTest {
diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MapMultipleValuesUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MapMultipleValuesUnitTest.java
similarity index 96%
rename from java-collections-maps/src/test/java/com/baeldung/java/map/MapMultipleValuesUnitTest.java
rename to java-collections-maps/src/test/java/com/baeldung/map/MapMultipleValuesUnitTest.java
index 3a0affa6f3..721b48ea7b 100644
--- a/java-collections-maps/src/test/java/com/baeldung/java/map/MapMultipleValuesUnitTest.java
+++ b/java-collections-maps/src/test/java/com/baeldung/map/MapMultipleValuesUnitTest.java
@@ -1,13 +1,9 @@
-package com.baeldung.java.map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+package com.baeldung.map;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.LinkedHashMultimap;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.TreeMultimap;
import org.apache.commons.collections4.MultiMap;
import org.apache.commons.collections4.MultiMapUtils;
import org.apache.commons.collections4.MultiValuedMap;
@@ -18,10 +14,9 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.LinkedHashMultimap;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.TreeMultimap;
+import java.util.*;
+
+import static org.assertj.core.api.Assertions.assertThat;
public class MapMultipleValuesUnitTest {
private static final Logger LOG = LoggerFactory.getLogger(MapMultipleValuesUnitTest.class);
diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MapUnitTest.java
similarity index 99%
rename from java-collections-maps/src/test/java/com/baeldung/java/map/MapUnitTest.java
rename to java-collections-maps/src/test/java/com/baeldung/map/MapUnitTest.java
index 7582eb87fb..eaf68ccba5 100644
--- a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUnitTest.java
+++ b/java-collections-maps/src/test/java/com/baeldung/map/MapUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.java.map;
+package com.baeldung.map;
import org.junit.Test;
import org.slf4j.Logger;
diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUtilUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MapUtilUnitTest.java
similarity index 99%
rename from java-collections-maps/src/test/java/com/baeldung/java/map/MapUtilUnitTest.java
rename to java-collections-maps/src/test/java/com/baeldung/map/MapUtilUnitTest.java
index e31385e972..f8e4c8fd8a 100644
--- a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUtilUnitTest.java
+++ b/java-collections-maps/src/test/java/com/baeldung/map/MapUtilUnitTest.java
@@ -1,9 +1,12 @@
/**
*
*/
-package com.baeldung.java.map;
+package com.baeldung.map;
-import static org.junit.Assert.assertEquals;
+import com.google.common.collect.HashBiMap;
+import org.apache.commons.collections4.BidiMap;
+import org.apache.commons.collections4.bidimap.DualHashBidiMap;
+import org.junit.Test;
import java.util.Arrays;
import java.util.HashMap;
@@ -11,11 +14,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.stream.Collectors;
-import org.apache.commons.collections4.BidiMap;
-import org.apache.commons.collections4.bidimap.DualHashBidiMap;
-import org.junit.Test;
-
-import com.google.common.collect.HashBiMap;
+import static org.junit.Assert.assertEquals;
/**
* @author swpraman
diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MultiValuedMapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MultiValuedMapUnitTest.java
similarity index 99%
rename from java-collections-maps/src/test/java/com/baeldung/java/map/MultiValuedMapUnitTest.java
rename to java-collections-maps/src/test/java/com/baeldung/map/MultiValuedMapUnitTest.java
index b3aaf8925f..686c1cef87 100644
--- a/java-collections-maps/src/test/java/com/baeldung/java/map/MultiValuedMapUnitTest.java
+++ b/java-collections-maps/src/test/java/com/baeldung/map/MultiValuedMapUnitTest.java
@@ -1,15 +1,4 @@
-package com.baeldung.java.map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
+package com.baeldung.map;
import org.apache.commons.collections4.MultiMapUtils;
import org.apache.commons.collections4.MultiSet;
@@ -18,6 +7,17 @@ import org.apache.commons.collections4.multimap.ArrayListValuedHashMap;
import org.apache.commons.collections4.multimap.HashSetValuedHashMap;
import org.junit.Test;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
public class MultiValuedMapUnitTest {
@Test
diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/compare/HashMapComparisonUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/compare/HashMapComparisonUnitTest.java
similarity index 97%
rename from java-collections-maps/src/test/java/com/baeldung/java/map/compare/HashMapComparisonUnitTest.java
rename to java-collections-maps/src/test/java/com/baeldung/map/compare/HashMapComparisonUnitTest.java
index e8aa12d4bd..0edd0cd87b 100644
--- a/java-collections-maps/src/test/java/com/baeldung/java/map/compare/HashMapComparisonUnitTest.java
+++ b/java-collections-maps/src/test/java/com/baeldung/map/compare/HashMapComparisonUnitTest.java
@@ -1,24 +1,21 @@
-package com.baeldung.java.map.compare;
+package com.baeldung.map.compare;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.collection.IsMapContaining.hasEntry;
-import static org.hamcrest.collection.IsMapContaining.hasKey;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import com.google.common.base.Equivalence;
+import com.google.common.collect.MapDifference;
+import com.google.common.collect.MapDifference.ValueDifference;
+import com.google.common.collect.Maps;
+import org.junit.Before;
+import org.junit.Test;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.google.common.base.Equivalence;
-import com.google.common.collect.MapDifference;
-import com.google.common.collect.MapDifference.ValueDifference;
-import com.google.common.collect.Maps;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsMapContaining.hasEntry;
+import static org.hamcrest.collection.IsMapContaining.hasKey;
+import static org.junit.Assert.*;
public class HashMapComparisonUnitTest {
diff --git a/java-ee-8-security-api/README.md b/java-ee-8-security-api/README.md
index 1735419236..5ecce2b4cc 100644
--- a/java-ee-8-security-api/README.md
+++ b/java-ee-8-security-api/README.md
@@ -1,3 +1,3 @@
### Relevant articles
- - [Java EE 8 Security API](http://www.baeldung.com/java-ee-8-security)
+ - [Java EE 8 Security API](https://www.baeldung.com/java-ee-8-security)
diff --git a/java-lite/README.md b/java-lite/README.md
index a4e2edd49f..5221b832f9 100644
--- a/java-lite/README.md
+++ b/java-lite/README.md
@@ -1,4 +1,4 @@
### Relevant Articles:
-- [A Guide to JavaLite – Building a RESTful CRUD application](http://www.baeldung.com/javalite-rest)
-- [Introduction to ActiveWeb](http://www.baeldung.com/activeweb)
+- [A Guide to JavaLite – Building a RESTful CRUD application](https://www.baeldung.com/javalite-rest)
+- [Introduction to ActiveWeb](https://www.baeldung.com/activeweb)
diff --git a/java-numbers-2/README.md b/java-numbers-2/README.md
index 1d2919aa63..5c6f46b05b 100644
--- a/java-numbers-2/README.md
+++ b/java-numbers-2/README.md
@@ -2,9 +2,10 @@
- [Lossy Conversion in Java](https://www.baeldung.com/java-lossy-conversion)
- [A Guide to the Java Math Class](https://www.baeldung.com/java-lang-math)
- [Calculate the Area of a Circle in Java](https://www.baeldung.com/java-calculate-circle-area)
-- [NaN in Java](http://www.baeldung.com/java-not-a-number)
-- [Generating Prime Numbers in Java](http://www.baeldung.com/java-generate-prime-numbers)
-- [Using Math.pow in Java](http://www.baeldung.com/java-math-pow)
-- [Check If a Number Is Prime in Java](http://www.baeldung.com/java-prime-numbers)
+- [NaN in Java](https://www.baeldung.com/java-not-a-number)
+- [Generating Prime Numbers in Java](https://www.baeldung.com/java-generate-prime-numbers)
+- [Using Math.pow in Java](https://www.baeldung.com/java-math-pow)
+- [Check If a Number Is Prime in Java](https://www.baeldung.com/java-prime-numbers)
- [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers)
- [Finding the Least Common Multiple in Java](https://www.baeldung.com/java-least-common-multiple)
+- [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers)
diff --git a/java-rmi/README.md b/java-rmi/README.md
index 4d12060395..201c4c8e66 100644
--- a/java-rmi/README.md
+++ b/java-rmi/README.md
@@ -1,3 +1,3 @@
### Relevant articles
-- [Getting Started with Java RMI](http://www.baeldung.com/java-rmi)
+- [Getting Started with Java RMI](https://www.baeldung.com/java-rmi)
diff --git a/java-spi/README.md b/java-spi/README.md
index d2658c42fe..25e2d10da4 100644
--- a/java-spi/README.md
+++ b/java-spi/README.md
@@ -1,4 +1,4 @@
### Relevant Articles:
-- [Java Service Provider Interface](http://www.baeldung.com/java-spi)
+- [Java Service Provider Interface](https://www.baeldung.com/java-spi)
diff --git a/java-streams/README.md b/java-streams/README.md
index 0c9588c47e..0d26c182ba 100644
--- a/java-streams/README.md
+++ b/java-streams/README.md
@@ -3,15 +3,15 @@
## Java Streams Cookbooks and Examples
### Relevant Articles:
-- [The Java 8 Stream API Tutorial](http://www.baeldung.com/java-8-streams)
-- [Introduction to Java 8 Streams](http://www.baeldung.com/java-8-streams-introduction)
-- [Java 8 and Infinite Streams](http://www.baeldung.com/java-inifinite-streams)
-- [Java 8 Stream findFirst() vs. findAny()](http://www.baeldung.com/java-stream-findfirst-vs-findany)
-- [How to Get the Last Element of a Stream in Java?](http://www.baeldung.com/java-stream-last-element)
-- [“Stream has already been operated upon or closed” Exception in Java](http://www.baeldung.com/java-stream-operated-upon-or-closed-exception)
-- [Iterable to Stream in Java](http://www.baeldung.com/java-iterable-to-stream)
-- [How to Iterate Over a Stream With Indices](http://www.baeldung.com/java-stream-indices)
-- [Primitive Type Streams in Java 8](http://www.baeldung.com/java-8-primitive-streams)
+- [The Java 8 Stream API Tutorial](https://www.baeldung.com/java-8-streams)
+- [Introduction to Java 8 Streams](https://www.baeldung.com/java-8-streams-introduction)
+- [Java 8 and Infinite Streams](https://www.baeldung.com/java-inifinite-streams)
+- [Java 8 Stream findFirst() vs. findAny()](https://www.baeldung.com/java-stream-findfirst-vs-findany)
+- [How to Get the Last Element of a Stream in Java?](https://www.baeldung.com/java-stream-last-element)
+- [“Stream has already been operated upon or closed” Exception in Java](https://www.baeldung.com/java-stream-operated-upon-or-closed-exception)
+- [Iterable to Stream in Java](https://www.baeldung.com/java-iterable-to-stream)
+- [How to Iterate Over a Stream With Indices](https://www.baeldung.com/java-stream-indices)
+- [Primitive Type Streams in Java 8](https://www.baeldung.com/java-8-primitive-streams)
- [Stream Ordering in Java](https://www.baeldung.com/java-stream-ordering)
- [Introduction to Protonpack](https://www.baeldung.com/java-protonpack)
- [Java Stream Filter with Lambda Expression](https://www.baeldung.com/java-stream-filter-lambda)
diff --git a/java-strings-2/README.md b/java-strings-2/README.md
index ad0a46fd96..166a8a2b1f 100644
--- a/java-strings-2/README.md
+++ b/java-strings-2/README.md
@@ -3,8 +3,8 @@
- [Java Localization – Formatting Messages](https://www.baeldung.com/java-localization-messages-formatting)
- [Check If a String Contains a Substring](https://www.baeldung.com/java-string-contains-substring)
- [Removing Stopwords from a String in Java](https://www.baeldung.com/java-string-remove-stopwords)
-- [Java – Generate Random String](http://www.baeldung.com/java-random-string)
-- [Image to Base64 String Conversion](http://www.baeldung.com/java-base64-image-string)
+- [Java – Generate Random String](https://www.baeldung.com/java-random-string)
+- [Image to Base64 String Conversion](https://www.baeldung.com/java-base64-image-string)
- [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode)
- [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password)
- [Removing Repeated Characters from a String](https://www.baeldung.com/java-remove-repeated-char)
@@ -12,7 +12,7 @@
- [Pad a String with Zeros or Spaces in Java](https://www.baeldung.com/java-pad-string)
- [Remove Emojis from a Java String](https://www.baeldung.com/java-string-remove-emojis)
- [Convert a Comma Separated String to a List in Java](https://www.baeldung.com/java-string-with-separator-to-list)
-- [Guide to java.util.Formatter](http://www.baeldung.com/java-string-formatter)
+- [Guide to java.util.Formatter](https://www.baeldung.com/java-string-formatter)
- [Remove Leading and Trailing Characters from a String](https://www.baeldung.com/java-remove-trailing-characters)
- [Concatenating Strings In Java](https://www.baeldung.com/java-strings-concatenation)
- [Java String Interview Questions and Answers](https://www.baeldung.com/java-string-interview-questions)
@@ -24,3 +24,4 @@
- [Checking If a String Is a Repeated Substring](https://www.baeldung.com/java-repeated-substring)
- [How to Reverse a String in Java](https://www.baeldung.com/java-reverse-string)
- [String toLowerCase and toUpperCase Methods in Java](https://www.baeldung.com/java-string-convert-case)
+- [Guide to StreamTokenizer](https://www.baeldung.com/java-streamtokenizer)
diff --git a/java-strings-ops/README.md b/java-strings-ops/README.md
index d909f171a7..d9c28dab0d 100644
--- a/java-strings-ops/README.md
+++ b/java-strings-ops/README.md
@@ -3,20 +3,20 @@
## Java Strings Cookbooks and Examples
### Relevant Articles:
-- [Convert char to String in Java](http://www.baeldung.com/java-convert-char-to-string)
-- [Convert String to int or Integer in Java](http://www.baeldung.com/java-convert-string-to-int-or-integer)
+- [Convert char to String in Java](https://www.baeldung.com/java-convert-char-to-string)
+- [Convert String to int or Integer in Java](https://www.baeldung.com/java-convert-string-to-int-or-integer)
- [Java String Conversions](https://www.baeldung.com/java-string-conversions)
-- [Check if a String is a Palindrome](http://www.baeldung.com/java-palindrome)
-- [Comparing Strings in Java](http://www.baeldung.com/java-compare-strings)
-- [Check If a String Is Numeric in Java](http://www.baeldung.com/java-check-string-number)
+- [Check if a String is a Palindrome](https://www.baeldung.com/java-palindrome)
+- [Comparing Strings in Java](https://www.baeldung.com/java-compare-strings)
+- [Check If a String Is Numeric in Java](https://www.baeldung.com/java-check-string-number)
- [Get Substring from String in Java](https://www.baeldung.com/java-substring)
-- [How to Remove the Last Character of a String?](http://www.baeldung.com/java-remove-last-character-of-string)
+- [How to Remove the Last Character of a String?](https://www.baeldung.com/java-remove-last-character-of-string)
- [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string)
-- [Count Occurrences of a Char in a String](http://www.baeldung.com/java-count-chars)
-- [Guide to Java String Pool](http://www.baeldung.com/java-string-pool)
-- [Split a String in Java](http://www.baeldung.com/java-split-string)
+- [Count Occurrences of a Char in a String](https://www.baeldung.com/java-count-chars)
+- [Guide to Java String Pool](https://www.baeldung.com/java-string-pool)
+- [Split a String in Java](https://www.baeldung.com/java-split-string)
- [Common String Operations in Java](https://www.baeldung.com/java-string-operations)
- [Convert String to Byte Array and Reverse in Java](https://www.baeldung.com/java-string-to-byte-array)
- [Java toString() Method](https://www.baeldung.com/java-tostring)
-- [CharSequence vs. String in Java](http://www.baeldung.com/java-char-sequence-string)
-- [StringBuilder and StringBuffer in Java](http://www.baeldung.com/java-string-builder-string-buffer)
\ No newline at end of file
+- [CharSequence vs. String in Java](https://www.baeldung.com/java-char-sequence-string)
+- [StringBuilder and StringBuffer in Java](https://www.baeldung.com/java-string-builder-string-buffer)
diff --git a/java-strings/README.md b/java-strings/README.md
index ef536b4099..5b2a327877 100644
--- a/java-strings/README.md
+++ b/java-strings/README.md
@@ -3,14 +3,14 @@
## Java Strings Cookbooks and Examples
### Relevant Articles:
-- [String Operations with Java Streams](http://www.baeldung.com/java-stream-operations-on-strings)
-- [Converting String to Stream of chars](http://www.baeldung.com/java-string-to-stream)
-- [Java 8 StringJoiner](http://www.baeldung.com/java-string-joiner)
-- [Converting Strings to Enums in Java](http://www.baeldung.com/java-string-to-enum)
-- [Quick Guide to the Java StringTokenizer](http://www.baeldung.com/java-stringtokenizer)
-- [Use char[] Array Over a String for Manipulating Passwords in Java?](http://www.baeldung.com/java-storing-passwords)
-- [Convert a String to Title Case](http://www.baeldung.com/java-string-title-case)
-- [Compact Strings in Java 9](http://www.baeldung.com/java-9-compact-string)
+- [String Operations with Java Streams](https://www.baeldung.com/java-stream-operations-on-strings)
+- [Converting String to Stream of chars](https://www.baeldung.com/java-string-to-stream)
+- [Java 8 StringJoiner](https://www.baeldung.com/java-string-joiner)
+- [Converting Strings to Enums in Java](https://www.baeldung.com/java-string-to-enum)
+- [Quick Guide to the Java StringTokenizer](https://www.baeldung.com/java-stringtokenizer)
+- [Use char[] Array Over a String for Manipulating Passwords in Java?](https://www.baeldung.com/java-storing-passwords)
+- [Convert a String to Title Case](https://www.baeldung.com/java-string-title-case)
+- [Compact Strings in Java 9](https://www.baeldung.com/java-9-compact-string)
- [Java Check a String for Lowercase/Uppercase Letter, Special Character and Digit](https://www.baeldung.com/java-lowercase-uppercase-special-character-digit-regex)
- [Convert java.util.Date to String](https://www.baeldung.com/java-util-date-to-string)
- [Converting a Stack Trace to a String in Java](https://www.baeldung.com/java-stacktrace-to-string)
@@ -20,4 +20,4 @@
- [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences)
- [Adding a Newline Character to a String in Java](https://www.baeldung.com/java-string-newline)
- [Remove or Replace part of a String in Java](https://www.baeldung.com/java-remove-replace-string-part)
-- [Replace a Character at a Specific Index in a String in Java](https://www.baeldung.com/java-replace-character-at-index)
\ No newline at end of file
+- [Replace a Character at a Specific Index in a String in Java](https://www.baeldung.com/java-replace-character-at-index)
diff --git a/java-vavr-stream/README.md b/java-vavr-stream/README.md
index 64299cde11..901978a1d8 100644
--- a/java-vavr-stream/README.md
+++ b/java-vavr-stream/README.md
@@ -1,5 +1,5 @@
### Relevant Articles:
-- [Java Streams vs Vavr Streams](http://www.baeldung.com/vavr-java-streams)
+- [Java Streams vs Vavr Streams](https://www.baeldung.com/vavr-java-streams)
diff --git a/java-websocket/README.md b/java-websocket/README.md
index f9f0784043..87cbb3fa5c 100644
--- a/java-websocket/README.md
+++ b/java-websocket/README.md
@@ -1,3 +1,3 @@
### Relevant articles
-- [A Guide to the Java API for WebSocket](http://www.baeldung.com/java-websockets)
+- [A Guide to the Java API for WebSocket](https://www.baeldung.com/java-websockets)
diff --git a/javafx/README.md b/javafx/README.md
index 66c81f17ad..7214321141 100644
--- a/javafx/README.md
+++ b/javafx/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
--[Introduction to JavaFX](http://www.baeldung.com/javafx)
+-[Introduction to JavaFX](https://www.baeldung.com/javafx)
diff --git a/javax-servlets/README.md b/javax-servlets/README.md
index 3c3b17996b..8254a78c4c 100644
--- a/javax-servlets/README.md
+++ b/javax-servlets/README.md
@@ -1,9 +1,10 @@
### Relevant Articles:
-- [Introduction to Java Servlets](http://www.baeldung.com/intro-to-servlets)
-- [An MVC Example with Servlets and JSP](http://www.baeldung.com/mvc-servlet-jsp)
-- [Handling Cookies and a Session in a Java Servlet](http://www.baeldung.com/java-servlet-cookies-session)
-- [Uploading Files with Servlets and JSP](http://www.baeldung.com/upload-file-servlet)
-- [Example of Downloading File in a Servlet](http://www.baeldung.com/servlet-download-file)
-- [Returning a JSON Response from a Servlet](http://www.baeldung.com/servlet-json-response)
-- [Java EE Servlet Exception Handling](http://www.baeldung.com/servlet-exceptions)
-- [Context and Servlet Initialization Parameters](http://www.baeldung.com/context-servlet-initialization-param)
+- [Introduction to Java Servlets](https://www.baeldung.com/intro-to-servlets)
+- [An MVC Example with Servlets and JSP](https://www.baeldung.com/mvc-servlet-jsp)
+- [Handling Cookies and a Session in a Java Servlet](https://www.baeldung.com/java-servlet-cookies-session)
+- [Uploading Files with Servlets and JSP](https://www.baeldung.com/upload-file-servlet)
+- [Example of Downloading File in a Servlet](https://www.baeldung.com/servlet-download-file)
+- [Returning a JSON Response from a Servlet](https://www.baeldung.com/servlet-json-response)
+- [Java EE Servlet Exception Handling](https://www.baeldung.com/servlet-exceptions)
+- [Context and Servlet Initialization Parameters](https://www.baeldung.com/context-servlet-initialization-param)
+- [The Difference between getRequestURI and getPathInfo in HttpServletRequest](https://www.baeldung.com/http-servlet-request-requesturi-pathinfo)
diff --git a/javaxval/README.md b/javaxval/README.md
index fadd174166..b141bc7859 100644
--- a/javaxval/README.md
+++ b/javaxval/README.md
@@ -3,7 +3,8 @@
## Java Bean Validation Examples
### Relevant Articles:
-- [Java Bean Validation Basics](http://www.baeldung.com/javax-validation)
-- [Validating Container Elements with Bean Validation 2.0](http://www.baeldung.com/bean-validation-container-elements)
-- [Method Constraints with Bean Validation 2.0](http://www.baeldung.com/javax-validation-method-constraints)
+- [Java Bean Validation Basics](https://www.baeldung.com/javax-validation)
+- [Validating Container Elements with Bean Validation 2.0](https://www.baeldung.com/bean-validation-container-elements)
+- [Method Constraints with Bean Validation 2.0](https://www.baeldung.com/javax-validation-method-constraints)
- [Difference Between @NotNull, @NotEmpty, and @NotBlank Constraints in Bean Validation](https://www.baeldung.com/java-bean-validation-not-null-empty-blank)
+- [Javax BigDecimal Validation](https://www.baeldung.com/javax-bigdecimal-validation)
diff --git a/jaxb/README.md b/jaxb/README.md
index 4b603fca00..bdaef90279 100644
--- a/jaxb/README.md
+++ b/jaxb/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Guide to JAXB](http://www.baeldung.com/jaxb)
+- [Guide to JAXB](https://www.baeldung.com/jaxb)
diff --git a/jee-7-security/README.md b/jee-7-security/README.md
index 314de6d957..70d451382c 100644
--- a/jee-7-security/README.md
+++ b/jee-7-security/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Securing Java EE with Spring Security](http://www.baeldung.com/java-ee-spring-security)
+- [Securing Java EE with Spring Security](https://www.baeldung.com/java-ee-spring-security)
diff --git a/jee-7/README.md b/jee-7/README.md
index c57863651d..2ae7335ce0 100644
--- a/jee-7/README.md
+++ b/jee-7/README.md
@@ -1,9 +1,9 @@
### Relevant Articles:
-- [Scheduling in Java EE](http://www.baeldung.com/scheduling-in-java-enterprise-edition)
-- [JSON Processing in Java EE 7](http://www.baeldung.com/jee7-json)
-- [Converters, Listeners and Validators in Java EE 7](http://www.baeldung.com/java-ee7-converter-listener-validator)
-- [Introduction to JAX-WS](http://www.baeldung.com/jax-ws)
-- [A Guide to Java EE Web-Related Annotations](http://www.baeldung.com/javaee-web-annotations)
-- [Introduction to Testing with Arquillian](http://www.baeldung.com/arquillian)
+- [Scheduling in Java EE](https://www.baeldung.com/scheduling-in-java-enterprise-edition)
+- [JSON Processing in Java EE 7](https://www.baeldung.com/jee7-json)
+- [Converters, Listeners and Validators in Java EE 7](https://www.baeldung.com/java-ee7-converter-listener-validator)
+- [Introduction to JAX-WS](https://www.baeldung.com/jax-ws)
+- [A Guide to Java EE Web-Related Annotations](https://www.baeldung.com/javaee-web-annotations)
+- [Introduction to Testing with Arquillian](https://www.baeldung.com/arquillian)
- [Java EE 7 Batch Processing](https://www.baeldung.com/java-ee-7-batch-processing)
- [The Difference Between CDI and EJB Singleton](https://www.baeldung.com/jee-cdi-vs-ejb-singleton)
diff --git a/jersey/README.md b/jersey/README.md
index 126dc542ba..1db89ec723 100644
--- a/jersey/README.md
+++ b/jersey/README.md
@@ -1,4 +1,4 @@
-- [Jersey Filters and Interceptors](http://www.baeldung.com/jersey-filters-interceptors)
+- [Jersey Filters and Interceptors](https://www.baeldung.com/jersey-filters-interceptors)
- [Jersey MVC Support](https://www.baeldung.com/jersey-mvc)
- [Bean Validation in Jersey](https://www.baeldung.com/jersey-bean-validation)
- [Set a Response Body in JAX-RS](https://www.baeldung.com/jax-rs-response)
diff --git a/jgit/README.md b/jgit/README.md
index 5c65f1101b..d89104293d 100644
--- a/jgit/README.md
+++ b/jgit/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [A Guide to JGit](http://www.baeldung.com/jgit)
+- [A Guide to JGit](https://www.baeldung.com/jgit)
diff --git a/jgroups/README.md b/jgroups/README.md
index 0921fa98a1..128007bb7e 100644
--- a/jgroups/README.md
+++ b/jgroups/README.md
@@ -1,7 +1,7 @@
## Reliable Messaging with JGroups Tutorial Project
### Relevant Article:
-- [Reliable Messaging with JGroups](http://www.baeldung.com/jgroups)
+- [Reliable Messaging with JGroups](https://www.baeldung.com/jgroups)
### Overview
This Maven project contains the Java code for the article linked above.
diff --git a/jhipster/jhipster-monolithic/README.md b/jhipster/jhipster-monolithic/README.md
index 65cc51ad88..de7c6ded74 100644
--- a/jhipster/jhipster-monolithic/README.md
+++ b/jhipster/jhipster-monolithic/README.md
@@ -1,6 +1,7 @@
## Relevant Articles
- [Intro to JHipster](https://www.baeldung.com/jhipster)
+- [Creating New Roles and Authorities in JHipster](https://www.baeldung.com/jhipster-new-roles)
# baeldung
diff --git a/jjwt/README.md b/jjwt/README.md
index ed18363dfc..04a85f3ded 100644
--- a/jjwt/README.md
+++ b/jjwt/README.md
@@ -45,4 +45,4 @@ Available commands (assumes httpie - https://github.com/jkbrzt/httpie):
## Relevant articles:
-- [Supercharge Java Authentication with JSON Web Tokens (JWTs)](http://www.baeldung.com/java-json-web-tokens-jjwt)
+- [Supercharge Java Authentication with JSON Web Tokens (JWTs)](https://www.baeldung.com/java-json-web-tokens-jjwt)
diff --git a/jmeter/README.md b/jmeter/README.md
index e3f9d1a4db..58522067b2 100644
--- a/jmeter/README.md
+++ b/jmeter/README.md
@@ -42,5 +42,5 @@ Enjoy it :)
### Relevant Articles:
-- [Intro to Performance Testing using JMeter](http://www.baeldung.com/jmeter)
-- [Configure Jenkins to Run and Show JMeter Tests](http://www.baeldung.com/jenkins-and-jmeter)
+- [Intro to Performance Testing using JMeter](https://www.baeldung.com/jmeter)
+- [Configure Jenkins to Run and Show JMeter Tests](https://www.baeldung.com/jenkins-and-jmeter)
diff --git a/jmh/README.md b/jmh/README.md
index 9c5a70e3c2..6876615328 100644
--- a/jmh/README.md
+++ b/jmh/README.md
@@ -1,4 +1,4 @@
## Relevant articles:
-- [Microbenchmarking with Java](http://www.baeldung.com/java-microbenchmark-harness)
+- [Microbenchmarking with Java](https://www.baeldung.com/java-microbenchmark-harness)
diff --git a/jni/README.md b/jni/README.md
index 663cafb0c0..daaeb7819f 100644
--- a/jni/README.md
+++ b/jni/README.md
@@ -1,4 +1,4 @@
### Relevant Articles:
-- [Guide to JNI (Java Native Interface)](http://www.baeldung.com/jni)
+- [Guide to JNI (Java Native Interface)](https://www.baeldung.com/jni)
diff --git a/jooby/README.md b/jooby/README.md
index aa867b2c56..bf8c580633 100644
--- a/jooby/README.md
+++ b/jooby/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [Introduction to Jooby](http://www.baeldung.com/jooby)
+- [Introduction to Jooby](https://www.baeldung.com/jooby)
diff --git a/jsf/README.md b/jsf/README.md
index d96c1eb8e3..65735cc406 100644
--- a/jsf/README.md
+++ b/jsf/README.md
@@ -1,5 +1,5 @@
### Relevant Articles:
-- [Guide to JSF Expression Language 3.0](http://www.baeldung.com/jsf-expression-language-el-3)
-- [Introduction to JSF EL 2](http://www.baeldung.com/intro-to-jsf-expression-language)
-- [JavaServer Faces (JSF) with Spring](http://www.baeldung.com/spring-jsf)
-- [Introduction to Primefaces](http://www.baeldung.com/jsf-primefaces)
+- [Guide to JSF Expression Language 3.0](https://www.baeldung.com/jsf-expression-language-el-3)
+- [Introduction to JSF EL 2](https://www.baeldung.com/intro-to-jsf-expression-language)
+- [JavaServer Faces (JSF) with Spring](https://www.baeldung.com/spring-jsf)
+- [Introduction to Primefaces](https://www.baeldung.com/jsf-primefaces)
diff --git a/json-path/README.md b/json-path/README.md
index 7a84ea7bde..41cc72a842 100644
--- a/json-path/README.md
+++ b/json-path/README.md
@@ -1,4 +1,4 @@
## Relevant articles:
-- [Introduction to JsonPath](http://www.baeldung.com/guide-to-jayway-jsonpath)
-- [Count with JsonPath](http://www.baeldung.com/jsonpath-count)
+- [Introduction to JsonPath](https://www.baeldung.com/guide-to-jayway-jsonpath)
+- [Count with JsonPath](https://www.baeldung.com/jsonpath-count)
diff --git a/json/README.md b/json/README.md
index 7ef4cc9b01..96acedd0b1 100644
--- a/json/README.md
+++ b/json/README.md
@@ -3,13 +3,13 @@
## Fast-Json
### Relevant Articles:
-- [Introduction to JSON Schema in Java](http://www.baeldung.com/introduction-to-json-schema-in-java)
-- [A Guide to FastJson](http://www.baeldung.com/fastjson)
-- [Introduction to JSONForms](http://www.baeldung.com/introduction-to-jsonforms)
-- [Introduction to JsonPath](http://www.baeldung.com/guide-to-jayway-jsonpath)
-- [Introduction to JSON-Java (org.json)](http://www.baeldung.com/java-org-json)
+- [Introduction to JSON Schema in Java](https://www.baeldung.com/introduction-to-json-schema-in-java)
+- [A Guide to FastJson](https://www.baeldung.com/fastjson)
+- [Introduction to JSONForms](https://www.baeldung.com/introduction-to-jsonforms)
+- [Introduction to JsonPath](https://www.baeldung.com/guide-to-jayway-jsonpath)
+- [Introduction to JSON-Java (org.json)](https://www.baeldung.com/java-org-json)
- [Overview of JSON Pointer](https://www.baeldung.com/json-pointer)
-- [Introduction to the JSON Binding API (JSR 367) in Java](http://www.baeldung.com/java-json-binding-api)
+- [Introduction to the JSON Binding API (JSR 367) in Java](https://www.baeldung.com/java-json-binding-api)
- [Get a Value by Key in a JSONArray](https://www.baeldung.com/java-jsonarray-get-value-by-key)
- [Iterating Over an Instance of org.json.JSONObject](https://www.baeldung.com/jsonobject-iteration)
- [Escape JSON String in Java](https://www.baeldung.com/java-json-escaping)
diff --git a/jsoup/README.md b/jsoup/README.md
index 8728cc7c4e..7624ce77bf 100644
--- a/jsoup/README.md
+++ b/jsoup/README.md
@@ -3,7 +3,7 @@
## jsoup Example Project
### Relevant Articles:
-- [Parsing HTML in Java with Jsoup](http://www.baeldung.com/java-with-jsoup)
+- [Parsing HTML in Java with Jsoup](https://www.baeldung.com/java-with-jsoup)
### Build the Project
diff --git a/jws/README.md b/jws/README.md
index 428d8b650d..b939941d22 100644
--- a/jws/README.md
+++ b/jws/README.md
@@ -1,3 +1,3 @@
### Relevant articles
-- [A Guide to the Java Web Start](http://www.baeldung.com/java-web-start)
+- [A Guide to the Java Web Start](https://www.baeldung.com/java-web-start)
diff --git a/kotlin-js/README.md b/kotlin-js/README.md
index 445ad6da9a..84d0c70427 100644
--- a/kotlin-js/README.md
+++ b/kotlin-js/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [Kotlin and Javascript](http://www.baeldung.com/kotlin-javascript)
+- [Kotlin and Javascript](https://www.baeldung.com/kotlin-javascript)
diff --git a/kotlin-libraries/README.md b/kotlin-libraries/README.md
index 94359193b6..6ad90c1cd2 100644
--- a/kotlin-libraries/README.md
+++ b/kotlin-libraries/README.md
@@ -1,14 +1,14 @@
## Relevant articles:
-- [Kotlin with Mockito](http://www.baeldung.com/kotlin-mockito)
-- [HTTP Requests with Kotlin and khttp](http://www.baeldung.com/kotlin-khttp)
-- [Kotlin Dependency Injection with Kodein](http://www.baeldung.com/kotlin-kodein-dependency-injection)
-- [Writing Specifications with Kotlin and Spek](http://www.baeldung.com/kotlin-spek)
-- [Processing JSON with Kotlin and Klaxson](http://www.baeldung.com/kotlin-json-klaxson)
+- [Kotlin with Mockito](https://www.baeldung.com/kotlin-mockito)
+- [HTTP Requests with Kotlin and khttp](https://www.baeldung.com/kotlin-khttp)
+- [Kotlin Dependency Injection with Kodein](https://www.baeldung.com/kotlin-kodein-dependency-injection)
+- [Writing Specifications with Kotlin and Spek](https://www.baeldung.com/kotlin-spek)
+- [Processing JSON with Kotlin and Klaxson](https://www.baeldung.com/kotlin-json-klaxson)
- [Guide to the Kotlin Exposed Framework](https://www.baeldung.com/kotlin-exposed-persistence)
- [Working with Dates in Kotlin](https://www.baeldung.com/kotlin-dates)
- [Introduction to Arrow in Kotlin](https://www.baeldung.com/kotlin-arrow)
- [Kotlin with Ktor](https://www.baeldung.com/kotlin-ktor)
- [REST API With Kotlin and Kovert](https://www.baeldung.com/kotlin-kovert)
- [MockK: A Mocking Library for Kotlin](https://www.baeldung.com/kotlin-mockk)
-- [Kotlin Immutable Collections](https://www.baeldung.com/kotlin-immutable-collections)
\ No newline at end of file
+- [Kotlin Immutable Collections](https://www.baeldung.com/kotlin-immutable-collections)
diff --git a/lagom/README.md b/lagom/README.md
index 909fe0dff4..a8070c047c 100644
--- a/lagom/README.md
+++ b/lagom/README.md
@@ -1,6 +1,6 @@
### Relevant articles
-- [Guide to Reactive Microservices Using Lagom Framework](http://www.baeldung.com/lagom-reactive-microservices)
+- [Guide to Reactive Microservices Using Lagom Framework](https://www.baeldung.com/lagom-reactive-microservices)
diff --git a/libraries-apache-commons-collections/README.md b/libraries-apache-commons-collections/README.md
new file mode 100644
index 0000000000..998ad1da09
--- /dev/null
+++ b/libraries-apache-commons-collections/README.md
@@ -0,0 +1,13 @@
+## Apache Commons Collections
+
+This module contains articles about Apache Commons Collections
+
+### Relevant articles
+
+- [Apache Commons Collections SetUtils](https://www.baeldung.com/apache-commons-setutils)
+- [Apache Commons Collections OrderedMap](https://www.baeldung.com/apache-commons-ordered-map)
+- [Guide to Apache Commons CircularFifoQueue](https://www.baeldung.com/commons-circular-fifo-queue)
+- [Apache Commons Collections Bag](https://www.baeldung.com/apache-commons-bag)
+- [A Guide to Apache Commons Collections CollectionUtils](https://www.baeldung.com/apache-commons-collection-utils)
+- [Apache Commons Collections BidiMap](https://www.baeldung.com/commons-collections-bidi-map)
+- [Apache Commons Collections MapUtils](https://www.baeldung.com/apache-commons-map-utils)
\ No newline at end of file
diff --git a/libraries-apache-commons-collections/pom.xml b/libraries-apache-commons-collections/pom.xml
new file mode 100644
index 0000000000..eba0ad331e
--- /dev/null
+++ b/libraries-apache-commons-collections/pom.xml
@@ -0,0 +1,40 @@
+
+
+ 4.0.0
+ libraries-apache-commons-collections
+ libraries-apache-commons-collections
+
+
+ parent-modules
+ com.baeldung
+ 1.0.0-SNAPSHOT
+
+
+
+
+ org.apache.commons
+ commons-collections4
+ ${commons.collections.version}
+
+
+ org.hamcrest
+ java-hamcrest
+ ${org.hamcrest.java-hamcrest.version}
+ test
+
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
+
+
+
+ 4.1
+ 3.6.2
+ 2.0.0.0
+
+
+
diff --git a/libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Address.java b/libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Address.java
similarity index 94%
rename from libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Address.java
rename to libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Address.java
index a1e231ec85..02c36a46f9 100644
--- a/libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Address.java
+++ b/libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Address.java
@@ -1,4 +1,4 @@
-package com.baeldung.commons.collectionutil;
+package com.baeldung.commons.collections.collectionutils;
public class Address {
diff --git a/libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Customer.java b/libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Customer.java
similarity index 97%
rename from libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Customer.java
rename to libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Customer.java
index 1c6a8dc4f1..7d6db68474 100644
--- a/libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Customer.java
+++ b/libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Customer.java
@@ -1,4 +1,4 @@
-package com.baeldung.commons.collectionutil;
+package com.baeldung.commons.collections.collectionutils;
public class Customer implements Comparable {
diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections4/BagUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BagUnitTest.java
similarity index 98%
rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections4/BagUnitTest.java
rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BagUnitTest.java
index ebad4093f0..0877e6d4ac 100644
--- a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections4/BagUnitTest.java
+++ b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BagUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.commons.collections4;
+package com.baeldung.commons.collections;
import org.apache.commons.collections4.Bag;
import org.apache.commons.collections4.SortedBag;
diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java
similarity index 100%
rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java
rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java
diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/MapUtilsUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/MapUtilsUnitTest.java
similarity index 100%
rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/MapUtilsUnitTest.java
rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/MapUtilsUnitTest.java
diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java
similarity index 100%
rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java
rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java
diff --git a/libraries-apache-commons/src/test/java/com/baeldung/circularfifoqueue/CircularFifoQueueUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/circularfifoqueue/CircularFifoQueueUnitTest.java
similarity index 98%
rename from libraries-apache-commons/src/test/java/com/baeldung/circularfifoqueue/CircularFifoQueueUnitTest.java
rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/circularfifoqueue/CircularFifoQueueUnitTest.java
index 39384a7442..5664c7b44e 100644
--- a/libraries-apache-commons/src/test/java/com/baeldung/circularfifoqueue/CircularFifoQueueUnitTest.java
+++ b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/circularfifoqueue/CircularFifoQueueUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.circularfifoqueue;
+package com.baeldung.commons.collections.circularfifoqueue;
import java.util.ArrayList;
import java.util.List;
diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/collectionutils/CollectionUtilsGuideUnitTest.java
similarity index 96%
rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideUnitTest.java
rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/collectionutils/CollectionUtilsGuideUnitTest.java
index 448c5b0729..e9a4612280 100644
--- a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideUnitTest.java
+++ b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/collectionutils/CollectionUtilsGuideUnitTest.java
@@ -1,7 +1,7 @@
-package com.baeldung.commons.collections;
+package com.baeldung.commons.collections.collectionutils;
-import com.baeldung.commons.collectionutil.Address;
-import com.baeldung.commons.collectionutil.Customer;
+import com.baeldung.commons.collections.collectionutils.Address;
+import com.baeldung.commons.collections.collectionutils.Customer;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.collections4.Transformer;
diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java
similarity index 97%
rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java
rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java
index c64143cba7..1ffc4a825f 100644
--- a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java
+++ b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java
@@ -1,211 +1,211 @@
-package com.baeldung.commons.collections.orderedmap;
-
-import org.apache.commons.collections4.OrderedMap;
-import org.apache.commons.collections4.OrderedMapIterator;
-import org.apache.commons.collections4.map.LinkedMap;
-import org.apache.commons.collections4.map.ListOrderedMap;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-public class OrderedMapUnitTest {
-
- private String[] names = { "Emily", "Mathew", "Rose", "John", "Anna" };
- private Integer[] ages = { 37, 28, 40, 36, 21 };
-
- private int RUNNERS_COUNT = names.length;
-
- private OrderedMap runnersLinkedMap;
- private OrderedMap runnersListOrderedMap;
-
- @Before
- public void createRunners() {
- // First implementation: ListOrderedMap
- this.runnersListOrderedMap = new ListOrderedMap<>();
- this.loadOrderedMapOfRunners(this.runnersListOrderedMap);
-
- // Second implementation: LinkedMap
- this.runnersLinkedMap = new LinkedMap<>();
- this.loadOrderedMapOfRunners(this.runnersLinkedMap);
- }
-
- private void loadOrderedMapOfRunners(OrderedMap runners) {
- for (int i = 0; i < RUNNERS_COUNT; i++) {
- runners.put(this.names[i], this.ages[i]);
- }
- }
-
- @Test
- public void givenALinkedMap_whenIteratedWithMapIterator_thenPreservesOrder() {
- // Tests that the order in map iterator is the same
- // as defined in the constant arrays of names and ages:
-
- OrderedMapIterator runnersIterator = this.runnersLinkedMap.mapIterator();
- int i = 0;
- while (runnersIterator.hasNext()) {
- runnersIterator.next();
- assertEquals(runnersIterator.getKey(), this.names[i]);
- assertEquals(runnersIterator.getValue(), this.ages[i]);
- i++;
- }
- }
-
- @Test
- public void givenAListOrderedMap_whenIteratedWithMapIterator_thenPreservesOrder() {
- // Tests that the order in map iterator is the same
- // as defined in the constant arrays of names and ages:
-
- OrderedMapIterator runnersIterator = this.runnersListOrderedMap.mapIterator();
- int i = 0;
- while (runnersIterator.hasNext()) {
- runnersIterator.next();
- assertEquals(runnersIterator.getKey(), this.names[i]);
- assertEquals(runnersIterator.getValue(), this.ages[i]);
- i++;
- }
- }
-
- @Test
- public void givenALinkedMap_whenIteratedForwards_thenPreservesOrder() {
- // Tests that the order in the forward iteration is the same
- // as defined in the constant arrays of names and ages
-
- String name = this.runnersLinkedMap.firstKey();
- int i = 0;
- while (name != null) {
- assertEquals(name, this.names[i]);
- name = this.runnersLinkedMap.nextKey(name);
- i++;
- }
- }
-
- @Test
- public void givenAListOrderedMap_whenIteratedForwards_thenPreservesOrder() {
- // Tests that the order in the forward iteration is the same
- // as defined in the constant arrays of names and ages
-
- String name = this.runnersListOrderedMap.firstKey();
- int i = 0;
- while (name != null) {
- assertEquals(name, this.names[i]);
- name = this.runnersListOrderedMap.nextKey(name);
- i++;
- }
- }
-
- @Test
- public void givenALinkedMap_whenIteratedBackwards_thenPreservesOrder() {
- // Tests that the order in the backwards iteration is the same
- // as defined in the constant arrays of names and ages
-
- String name = this.runnersLinkedMap.lastKey();
- int i = RUNNERS_COUNT - 1;
- while (name != null) {
- assertEquals(name, this.names[i]);
- name = this.runnersLinkedMap.previousKey(name);
- i--;
- }
- }
-
- @Test
- public void givenAListOrderedMap_whenIteratedBackwards_thenPreservesOrder() {
- // Tests that the order in the backwards iteration is the same
- // as defined in the constant arrays of names and ages
-
- String name = this.runnersListOrderedMap.lastKey();
- int i = RUNNERS_COUNT - 1;
- while (name != null) {
- assertEquals(name, this.names[i]);
- name = this.runnersListOrderedMap.previousKey(name);
- i--;
- }
- }
-
- @Test
- public void givenALinkedMap_whenObjectIsSearched_thenMatchesConstantArray() {
- assertEquals(ages[4], this.runnersLinkedMap.get("Anna"));
- }
-
- @Test
- public void givenALinkedMap_whenConvertedToList_thenMatchesKeySet() {
- // Casting the OrderedMap to a LinkedMap we can use asList() method
-
- LinkedMap lmap = (LinkedMap) this.runnersLinkedMap;
- List listKeys = new ArrayList<>();
- listKeys.addAll(this.runnersLinkedMap.keySet());
- List linkedMap = lmap.asList();
- assertEquals(listKeys, linkedMap);
- }
-
- @Test
- public void givenALinkedMap_whenSearchByIndexIsUsed_thenMatchesConstantArray() {
- LinkedMap lmap = (LinkedMap) this.runnersLinkedMap;
-
- for (int i = 0; i < RUNNERS_COUNT; i++) {
- // accessed by index:
- String name = lmap.get(i);
- assertEquals(name, this.names[i]);
-
- // index of key concides with position in array
- assertEquals(lmap.indexOf(this.names[i]), i);
- }
- }
-
- @Test
- public void givenALinkedMap_whenElementRemoved_thenSizeDecrease() {
- LinkedMap lmap = (LinkedMap) this.runnersLinkedMap;
- Integer johnAge = lmap.remove("John");// by object
- assertEquals(johnAge, new Integer(36));
- assertEquals(lmap.size(), RUNNERS_COUNT - 1);
-
- Integer emilyAge = lmap.remove(0);// by index
- assertEquals(emilyAge, new Integer(37));
- assertEquals(lmap.size(), RUNNERS_COUNT - 2);
- }
-
- @Test
- public void givenAListOrderedMap_whenObjectIsSearched_thenMatchesConstantArray() {
- assertEquals(ages[4], this.runnersListOrderedMap.get("Anna"));
- }
-
- @Test
- public void givenAListOrderedMap_whenConvertedToList_thenMatchesKeySet() {
- ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap;
- List listKeys = new ArrayList<>();
- listKeys.addAll(this.runnersListOrderedMap.keySet());
- List lomapList = lomap.asList();
- assertEquals(listKeys, lomapList);
- }
-
- @Test
- public void givenAListOrderedMap_whenSearchByIndexIsUsed_thenMatchesConstantArray() {
- ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap;
-
- for (int i = 0; i < RUNNERS_COUNT; i++) {
- // accessed by index:
- String name = lomap.get(i);
- assertEquals(name, this.names[i]);
-
- // index of key concides with position in array
- assertEquals(lomap.indexOf(this.names[i]), i);
- }
- }
-
- @Test
- public void givenAListOrderedMap_whenElementRemoved_thenSizeDecrease() {
- ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap;
-
- Integer johnAge = lomap.remove("John");// by object
-
- assertEquals(johnAge, new Integer(36));
- assertEquals(lomap.size(), RUNNERS_COUNT - 1);
-
- Integer emilyAge = lomap.remove(0);// by index
- assertEquals(emilyAge, new Integer(37));
- assertEquals(lomap.size(), RUNNERS_COUNT - 2);
- }
-}
+package com.baeldung.commons.collections.orderedmap;
+
+import org.apache.commons.collections4.OrderedMap;
+import org.apache.commons.collections4.OrderedMapIterator;
+import org.apache.commons.collections4.map.LinkedMap;
+import org.apache.commons.collections4.map.ListOrderedMap;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class OrderedMapUnitTest {
+
+ private String[] names = { "Emily", "Mathew", "Rose", "John", "Anna" };
+ private Integer[] ages = { 37, 28, 40, 36, 21 };
+
+ private int RUNNERS_COUNT = names.length;
+
+ private OrderedMap runnersLinkedMap;
+ private OrderedMap runnersListOrderedMap;
+
+ @Before
+ public void createRunners() {
+ // First implementation: ListOrderedMap
+ this.runnersListOrderedMap = new ListOrderedMap<>();
+ this.loadOrderedMapOfRunners(this.runnersListOrderedMap);
+
+ // Second implementation: LinkedMap
+ this.runnersLinkedMap = new LinkedMap<>();
+ this.loadOrderedMapOfRunners(this.runnersLinkedMap);
+ }
+
+ private void loadOrderedMapOfRunners(OrderedMap runners) {
+ for (int i = 0; i < RUNNERS_COUNT; i++) {
+ runners.put(this.names[i], this.ages[i]);
+ }
+ }
+
+ @Test
+ public void givenALinkedMap_whenIteratedWithMapIterator_thenPreservesOrder() {
+ // Tests that the order in map iterator is the same
+ // as defined in the constant arrays of names and ages:
+
+ OrderedMapIterator runnersIterator = this.runnersLinkedMap.mapIterator();
+ int i = 0;
+ while (runnersIterator.hasNext()) {
+ runnersIterator.next();
+ assertEquals(runnersIterator.getKey(), this.names[i]);
+ assertEquals(runnersIterator.getValue(), this.ages[i]);
+ i++;
+ }
+ }
+
+ @Test
+ public void givenAListOrderedMap_whenIteratedWithMapIterator_thenPreservesOrder() {
+ // Tests that the order in map iterator is the same
+ // as defined in the constant arrays of names and ages:
+
+ OrderedMapIterator runnersIterator = this.runnersListOrderedMap.mapIterator();
+ int i = 0;
+ while (runnersIterator.hasNext()) {
+ runnersIterator.next();
+ assertEquals(runnersIterator.getKey(), this.names[i]);
+ assertEquals(runnersIterator.getValue(), this.ages[i]);
+ i++;
+ }
+ }
+
+ @Test
+ public void givenALinkedMap_whenIteratedForwards_thenPreservesOrder() {
+ // Tests that the order in the forward iteration is the same
+ // as defined in the constant arrays of names and ages
+
+ String name = this.runnersLinkedMap.firstKey();
+ int i = 0;
+ while (name != null) {
+ assertEquals(name, this.names[i]);
+ name = this.runnersLinkedMap.nextKey(name);
+ i++;
+ }
+ }
+
+ @Test
+ public void givenAListOrderedMap_whenIteratedForwards_thenPreservesOrder() {
+ // Tests that the order in the forward iteration is the same
+ // as defined in the constant arrays of names and ages
+
+ String name = this.runnersListOrderedMap.firstKey();
+ int i = 0;
+ while (name != null) {
+ assertEquals(name, this.names[i]);
+ name = this.runnersListOrderedMap.nextKey(name);
+ i++;
+ }
+ }
+
+ @Test
+ public void givenALinkedMap_whenIteratedBackwards_thenPreservesOrder() {
+ // Tests that the order in the backwards iteration is the same
+ // as defined in the constant arrays of names and ages
+
+ String name = this.runnersLinkedMap.lastKey();
+ int i = RUNNERS_COUNT - 1;
+ while (name != null) {
+ assertEquals(name, this.names[i]);
+ name = this.runnersLinkedMap.previousKey(name);
+ i--;
+ }
+ }
+
+ @Test
+ public void givenAListOrderedMap_whenIteratedBackwards_thenPreservesOrder() {
+ // Tests that the order in the backwards iteration is the same
+ // as defined in the constant arrays of names and ages
+
+ String name = this.runnersListOrderedMap.lastKey();
+ int i = RUNNERS_COUNT - 1;
+ while (name != null) {
+ assertEquals(name, this.names[i]);
+ name = this.runnersListOrderedMap.previousKey(name);
+ i--;
+ }
+ }
+
+ @Test
+ public void givenALinkedMap_whenObjectIsSearched_thenMatchesConstantArray() {
+ assertEquals(ages[4], this.runnersLinkedMap.get("Anna"));
+ }
+
+ @Test
+ public void givenALinkedMap_whenConvertedToList_thenMatchesKeySet() {
+ // Casting the OrderedMap to a LinkedMap we can use asList() method
+
+ LinkedMap lmap = (LinkedMap) this.runnersLinkedMap;
+ List listKeys = new ArrayList<>();
+ listKeys.addAll(this.runnersLinkedMap.keySet());
+ List linkedMap = lmap.asList();
+ assertEquals(listKeys, linkedMap);
+ }
+
+ @Test
+ public void givenALinkedMap_whenSearchByIndexIsUsed_thenMatchesConstantArray() {
+ LinkedMap lmap = (LinkedMap) this.runnersLinkedMap;
+
+ for (int i = 0; i < RUNNERS_COUNT; i++) {
+ // accessed by index:
+ String name = lmap.get(i);
+ assertEquals(name, this.names[i]);
+
+ // index of key concides with position in array
+ assertEquals(lmap.indexOf(this.names[i]), i);
+ }
+ }
+
+ @Test
+ public void givenALinkedMap_whenElementRemoved_thenSizeDecrease() {
+ LinkedMap lmap = (LinkedMap) this.runnersLinkedMap;
+ Integer johnAge = lmap.remove("John");// by object
+ assertEquals(johnAge, new Integer(36));
+ assertEquals(lmap.size(), RUNNERS_COUNT - 1);
+
+ Integer emilyAge = lmap.remove(0);// by index
+ assertEquals(emilyAge, new Integer(37));
+ assertEquals(lmap.size(), RUNNERS_COUNT - 2);
+ }
+
+ @Test
+ public void givenAListOrderedMap_whenObjectIsSearched_thenMatchesConstantArray() {
+ assertEquals(ages[4], this.runnersListOrderedMap.get("Anna"));
+ }
+
+ @Test
+ public void givenAListOrderedMap_whenConvertedToList_thenMatchesKeySet() {
+ ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap;
+ List listKeys = new ArrayList<>();
+ listKeys.addAll(this.runnersListOrderedMap.keySet());
+ List lomapList = lomap.asList();
+ assertEquals(listKeys, lomapList);
+ }
+
+ @Test
+ public void givenAListOrderedMap_whenSearchByIndexIsUsed_thenMatchesConstantArray() {
+ ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap;
+
+ for (int i = 0; i < RUNNERS_COUNT; i++) {
+ // accessed by index:
+ String name = lomap.get(i);
+ assertEquals(name, this.names[i]);
+
+ // index of key concides with position in array
+ assertEquals(lomap.indexOf(this.names[i]), i);
+ }
+ }
+
+ @Test
+ public void givenAListOrderedMap_whenElementRemoved_thenSizeDecrease() {
+ ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap;
+
+ Integer johnAge = lomap.remove("John");// by object
+
+ assertEquals(johnAge, new Integer(36));
+ assertEquals(lomap.size(), RUNNERS_COUNT - 1);
+
+ Integer emilyAge = lomap.remove(0);// by index
+ assertEquals(emilyAge, new Integer(37));
+ assertEquals(lomap.size(), RUNNERS_COUNT - 2);
+ }
+}
diff --git a/libraries-apache-commons-io/README.md b/libraries-apache-commons-io/README.md
new file mode 100644
index 0000000000..d5f29499d2
--- /dev/null
+++ b/libraries-apache-commons-io/README.md
@@ -0,0 +1,7 @@
+## Apache Commons Collections
+
+This module contains articles about Apache Commons IO
+
+### Relevant articles
+- [Apache Commons IO](https://www.baeldung.com/apache-commons-io)
+- [Introduction to Apache Commons CSV](https://www.baeldung.com/apache-commons-csv)
diff --git a/libraries-apache-commons-io/pom.xml b/libraries-apache-commons-io/pom.xml
new file mode 100644
index 0000000000..7ec71d8264
--- /dev/null
+++ b/libraries-apache-commons-io/pom.xml
@@ -0,0 +1,31 @@
+
+
+ 4.0.0
+ libraries-apache-commons-io
+ libraries-apache-commons-io
+
+
+ parent-modules
+ com.baeldung
+ 1.0.0-SNAPSHOT
+
+
+
+
+ org.apache.commons
+ commons-csv
+ ${commons-csv.version}
+
+
+ commons-io
+ commons-io
+ ${commons-io.version}
+
+
+
+
+ 1.4
+
+
+
diff --git a/libraries-apache-commons/src/main/java/com/baeldung/commons/io/FileMonitor.java b/libraries-apache-commons-io/src/main/java/com/baeldung/commons/io/FileMonitor.java
similarity index 100%
rename from libraries-apache-commons/src/main/java/com/baeldung/commons/io/FileMonitor.java
rename to libraries-apache-commons-io/src/main/java/com/baeldung/commons/io/FileMonitor.java
diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/io/CommonsIOUnitTest.java b/libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/CommonsIOUnitTest.java
similarity index 100%
rename from libraries-apache-commons/src/test/java/com/baeldung/commons/io/CommonsIOUnitTest.java
rename to libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/CommonsIOUnitTest.java
diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/csv/CSVReaderWriterUnitTest.java b/libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/csv/CSVReaderWriterUnitTest.java
similarity index 98%
rename from libraries-apache-commons/src/test/java/com/baeldung/commons/csv/CSVReaderWriterUnitTest.java
rename to libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/csv/CSVReaderWriterUnitTest.java
index f93e59ed75..b99f4e8bc3 100644
--- a/libraries-apache-commons/src/test/java/com/baeldung/commons/csv/CSVReaderWriterUnitTest.java
+++ b/libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/csv/CSVReaderWriterUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.commons.csv;
+package com.baeldung.commons.io.csv;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
diff --git a/libraries-apache-commons/src/test/resources/aaa.txt b/libraries-apache-commons-io/src/test/resources/aaa.txt
similarity index 100%
rename from libraries-apache-commons/src/test/resources/aaa.txt
rename to libraries-apache-commons-io/src/test/resources/aaa.txt
diff --git a/libraries-apache-commons/src/test/resources/book.csv b/libraries-apache-commons-io/src/test/resources/book.csv
similarity index 100%
rename from libraries-apache-commons/src/test/resources/book.csv
rename to libraries-apache-commons-io/src/test/resources/book.csv
diff --git a/libraries-apache-commons/src/test/resources/fileTest.txt b/libraries-apache-commons-io/src/test/resources/fileTest.txt
similarity index 100%
rename from libraries-apache-commons/src/test/resources/fileTest.txt
rename to libraries-apache-commons-io/src/test/resources/fileTest.txt
diff --git a/libraries-apache-commons/src/test/resources/sample.txt b/libraries-apache-commons-io/src/test/resources/sample.txt
similarity index 100%
rename from libraries-apache-commons/src/test/resources/sample.txt
rename to libraries-apache-commons-io/src/test/resources/sample.txt
diff --git a/libraries-apache-commons/.gitignore b/libraries-apache-commons/.gitignore
deleted file mode 100644
index e594daf27a..0000000000
--- a/libraries-apache-commons/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.class
-
-# Folders #
-/gensrc
-/target
-
-# Packaged files #
-*.jar
-/bin/
diff --git a/libraries-apache-commons/README.md b/libraries-apache-commons/README.md
index 01f2379588..7d1f5b8333 100644
--- a/libraries-apache-commons/README.md
+++ b/libraries-apache-commons/README.md
@@ -1,20 +1,11 @@
### Relevant articles
-- [Array Processing with Apache Commons Lang 3](http://www.baeldung.com/array-processing-commons-lang)
-- [String Processing with Apache Commons Lang 3](http://www.baeldung.com/string-processing-commons-lang)
-- [Introduction to Apache Commons Math](http://www.baeldung.com/apache-commons-math)
-- [Apache Commons Collections SetUtils](http://www.baeldung.com/apache-commons-setutils)
-- [Apache Commons Collections OrderedMap](http://www.baeldung.com/apache-commons-ordered-map)
-- [Introduction to Apache Commons Text](http://www.baeldung.com/java-apache-commons-text)
-- [A Guide to Apache Commons DbUtils](http://www.baeldung.com/apache-commons-dbutils)
-- [Guide to Apache Commons CircularFifoQueue](http://www.baeldung.com/commons-circular-fifo-queue)
-- [Apache Commons Chain](http://www.baeldung.com/apache-commons-chain)
-- [Introduction to Apache Commons CSV](http://www.baeldung.com/apache-commons-csv)
-- [Apache Commons IO](http://www.baeldung.com/apache-commons-io)
-- [Apache Commons Collections Bag](http://www.baeldung.com/apache-commons-bag)
-- [A Guide to Apache Commons Collections CollectionUtils](http://www.baeldung.com/apache-commons-collection-utils)
-- [Apache Commons BeanUtils](http://www.baeldung.com/apache-commons-beanutils)
-- [Apache Commons Collections BidiMap](http://www.baeldung.com/commons-collections-bidi-map)
-- [Apache Commons Collections MapUtils](http://www.baeldung.com/apache-commons-map-utils)
-- [Histograms with Apache Commons Frequency](http://www.baeldung.com/apache-commons-frequency)
-- [An Introduction to Apache Commons Lang 3](https://www.baeldung.com/java-commons-lang-3)
\ No newline at end of file
+- [Array Processing with Apache Commons Lang 3](https://www.baeldung.com/array-processing-commons-lang)
+- [String Processing with Apache Commons Lang 3](https://www.baeldung.com/string-processing-commons-lang)
+- [Introduction to Apache Commons Math](https://www.baeldung.com/apache-commons-math)
+- [Introduction to Apache Commons Text](https://www.baeldung.com/java-apache-commons-text)
+- [A Guide to Apache Commons DbUtils](https://www.baeldung.com/apache-commons-dbutils)
+- [Apache Commons Chain](https://www.baeldung.com/apache-commons-chain)
+- [Apache Commons BeanUtils](https://www.baeldung.com/apache-commons-beanutils)
+- [Histograms with Apache Commons Frequency](https://www.baeldung.com/apache-commons-frequency)
+- [An Introduction to Apache Commons Lang 3](https://www.baeldung.com/java-commons-lang-3)
diff --git a/libraries-apache-commons/pom.xml b/libraries-apache-commons/pom.xml
index 05d11d83fe..f83a8c7304 100644
--- a/libraries-apache-commons/pom.xml
+++ b/libraries-apache-commons/pom.xml
@@ -32,21 +32,11 @@
commons-text${commons-text.version}
-
- commons-io
- commons-io
- ${commons-io.version}
- commons-chaincommons-chain${commons-chain.version}
-
- org.apache.commons
- commons-csv
- ${commons-csv.version}
- commons-dbutilscommons-dbutils
@@ -72,18 +62,6 @@
xchart${xchart-version}
-
- org.apache.commons
- commons-collections4
- ${commons.collections.version}
-
-
- org.hamcrest
- java-hamcrest
- ${org.hamcrest.java-hamcrest.version}
- test
-
-
@@ -91,11 +69,8 @@
1.11.9.31.2
- 1.43.6.21.6
- 4.1
- 2.0.0.01.10.L0013.5.23.6
diff --git a/libraries-data-2/README.md b/libraries-data-2/README.md
index 8101138c0e..ae113e7f70 100644
--- a/libraries-data-2/README.md
+++ b/libraries-data-2/README.md
@@ -1,11 +1,11 @@
### Relevant articles
-- [Introduction to Apache Flink with Java](http://www.baeldung.com/apache-flink)
-- [Guide to the HyperLogLog Algorithm](http://www.baeldung.com/java-hyperloglog)
-- [Introduction to Conflict-Free Replicated Data Types](http://www.baeldung.com/java-conflict-free-replicated-data-types)
-- [Introduction to javax.measure](http://www.baeldung.com/javax-measure)
-- [Introduction To Docx4J](http://www.baeldung.com/docx4j)
-- [Interact with Google Sheets from Java](http://www.baeldung.com/google-sheets-java-client)
-- [Introduction To OpenCSV](http://www.baeldung.com/opencsv)
-- [Introduction to Smooks](http://www.baeldung.com/smooks)
-- [A Guide to Infinispan in Java](http://www.baeldung.com/infinispan)
+- [Introduction to Apache Flink with Java](https://www.baeldung.com/apache-flink)
+- [Guide to the HyperLogLog Algorithm](https://www.baeldung.com/java-hyperloglog)
+- [Introduction to Conflict-Free Replicated Data Types](https://www.baeldung.com/java-conflict-free-replicated-data-types)
+- [Introduction to javax.measure](https://www.baeldung.com/javax-measure)
+- [Introduction To Docx4J](https://www.baeldung.com/docx4j)
+- [Interact with Google Sheets from Java](https://www.baeldung.com/google-sheets-java-client)
+- [Introduction To OpenCSV](https://www.baeldung.com/opencsv)
+- [Introduction to Smooks](https://www.baeldung.com/smooks)
+- [A Guide to Infinispan in Java](https://www.baeldung.com/infinispan)
diff --git a/libraries-data-3/README.md b/libraries-data-3/README.md
index 7f939e7909..6be6eae4a8 100644
--- a/libraries-data-3/README.md
+++ b/libraries-data-3/README.md
@@ -1,5 +1,5 @@
### Relevant articles
-- [Parsing YAML with SnakeYAML](http://www.baeldung.com/java-snake-yaml)
+- [Parsing YAML with SnakeYAML](https://www.baeldung.com/java-snake-yaml)
- [Guide to JMapper](https://www.baeldung.com/jmapper)
- [An Introduction to SuanShu](https://www.baeldung.com/suanshu)
- [Intro to Derive4J](https://www.baeldung.com/derive4j)
diff --git a/libraries-data/README.md b/libraries-data/README.md
index 92c546c258..e1d3c40222 100644
--- a/libraries-data/README.md
+++ b/libraries-data/README.md
@@ -1,16 +1,17 @@
### Relevant articles
-- [Introduction to Reladomo](http://www.baeldung.com/reladomo)
-- [Introduction to ORMLite](http://www.baeldung.com/ormlite)
-- [Introduction To Kryo](http://www.baeldung.com/kryo)
-- [Introduction to KafkaStreams in Java](http://www.baeldung.com/java-kafka-streams)
-- [Guide to Java Data Objects](http://www.baeldung.com/jdo)
-- [Intro to JDO Queries 2/2](http://www.baeldung.com/jdo-queries)
-- [Introduction to HikariCP](http://www.baeldung.com/hikaricp)
-- [Introduction to JCache](http://www.baeldung.com/jcache)
-- [A Guide to Apache Ignite](http://www.baeldung.com/apache-ignite)
-- [Apache Ignite with Spring Data](http://www.baeldung.com/apache-ignite-spring-data)
+- [Introduction to Reladomo](https://www.baeldung.com/reladomo)
+- [Introduction to ORMLite](https://www.baeldung.com/ormlite)
+- [Introduction To Kryo](https://www.baeldung.com/kryo)
+- [Introduction to KafkaStreams in Java](https://www.baeldung.com/java-kafka-streams)
+- [Guide to Java Data Objects](https://www.baeldung.com/jdo)
+- [Intro to JDO Queries 2/2](https://www.baeldung.com/jdo-queries)
+- [Introduction to HikariCP](https://www.baeldung.com/hikaricp)
+- [Introduction to JCache](https://www.baeldung.com/jcache)
+- [A Guide to Apache Ignite](https://www.baeldung.com/apache-ignite)
+- [Apache Ignite with Spring Data](https://www.baeldung.com/apache-ignite-spring-data)
- [A Guide to Apache Crunch](https://www.baeldung.com/apache-crunch)
- [Intro to Apache Storm](https://www.baeldung.com/apache-storm)
- [Guide to Ebean ORM](https://www.baeldung.com/ebean-orm)
- [Introduction to Kafka Connectors](https://www.baeldung.com/kafka-connectors-guide)
- [Kafka Connect Example with MQTT and MongoDB](https://www.baeldung.com/kafka-connect-mqtt-mongodb)
+- [Building a Data Pipeline with Flink and Kafka](https://www.baeldung.com/kafka-flink-data-pipeline)
diff --git a/libraries-http/README.md b/libraries-http/README.md
index d5eaed0736..436268e707 100644
--- a/libraries-http/README.md
+++ b/libraries-http/README.md
@@ -1,11 +1,11 @@
### Relevant Articles:
-- [A Guide to OkHttp](http://www.baeldung.com/guide-to-okhttp)
-- [A Guide to Google-Http-Client](http://www.baeldung.com/google-http-client)
-- [Asynchronous HTTP with async-http-client in Java](http://www.baeldung.com/async-http-client)
-- [WebSockets with AsyncHttpClient](http://www.baeldung.com/async-http-client-websockets)
-- [Integrating Retrofit with RxJava](http://www.baeldung.com/retrofit-rxjava)
-- [Introduction to Retrofit](http://www.baeldung.com/retrofit)
-- [A Guide to Unirest](http://www.baeldung.com/unirest)
-- [Creating REST Microservices with Javalin](http://www.baeldung.com/javalin-rest-microservices)
\ No newline at end of file
+- [A Guide to OkHttp](https://www.baeldung.com/guide-to-okhttp)
+- [A Guide to Google-Http-Client](https://www.baeldung.com/google-http-client)
+- [Asynchronous HTTP with async-http-client in Java](https://www.baeldung.com/async-http-client)
+- [WebSockets with AsyncHttpClient](https://www.baeldung.com/async-http-client-websockets)
+- [Integrating Retrofit with RxJava](https://www.baeldung.com/retrofit-rxjava)
+- [Introduction to Retrofit](https://www.baeldung.com/retrofit)
+- [A Guide to Unirest](https://www.baeldung.com/unirest)
+- [Creating REST Microservices with Javalin](https://www.baeldung.com/javalin-rest-microservices)
diff --git a/libraries-server/README.md b/libraries-server/README.md
index b5392f5883..5245b98139 100644
--- a/libraries-server/README.md
+++ b/libraries-server/README.md
@@ -1,11 +1,11 @@
## Relevant Articles:
-- [Embedded Jetty Server in Java](http://www.baeldung.com/jetty-embedded)
-- [Introduction to Netty](http://www.baeldung.com/netty)
-- [Exceptions in Netty](http://www.baeldung.com/netty-exception-handling)
-- [Programmatically Create, Configure and Run a Tomcat Server](http://www.baeldung.com/tomcat-programmatic-setup)
-- [Creating and Configuring Jetty 9 Server in Java](http://www.baeldung.com/jetty-java-programmatic)
-- [Testing Netty with EmbeddedChannel](http://www.baeldung.com/testing-netty-embedded-channel)
+- [Embedded Jetty Server in Java](https://www.baeldung.com/jetty-embedded)
+- [Introduction to Netty](https://www.baeldung.com/netty)
+- [Exceptions in Netty](https://www.baeldung.com/netty-exception-handling)
+- [Programmatically Create, Configure and Run a Tomcat Server](https://www.baeldung.com/tomcat-programmatic-setup)
+- [Creating and Configuring Jetty 9 Server in Java](https://www.baeldung.com/jetty-java-programmatic)
+- [Testing Netty with EmbeddedChannel](https://www.baeldung.com/testing-netty-embedded-channel)
- [MQTT Client in Java](https://www.baeldung.com/java-mqtt-client)
- [Guide to XMPP Smack Client](https://www.baeldung.com/xmpp-smack-chat-client)
- [A Guide to NanoHTTPD](https://www.baeldung.com/nanohttpd)
diff --git a/libraries-testing/README.md b/libraries-testing/README.md
index fb2c7123a3..3f1904dc50 100644
--- a/libraries-testing/README.md
+++ b/libraries-testing/README.md
@@ -1,9 +1,9 @@
### Relevant articles
-- [Introduction to Serenity BDD](http://www.baeldung.com/serenity-bdd)
-- [Introduction to JSONassert](http://www.baeldung.com/jsonassert)
-- [Serenity BDD and Screenplay](http://www.baeldung.com/serenity-screenplay)
-- [Serenity BDD with Spring and JBehave](http://www.baeldung.com/serenity-spring-jbehave)
-- [Introduction to Awaitlity](http://www.baeldung.com/awaitlity-testing)
-- [Introduction to Hoverfly in Java](http://www.baeldung.com/hoverfly)
-- [Testing with Hamcrest](http://www.baeldung.com/java-junit-hamcrest-guide)
\ No newline at end of file
+- [Introduction to Serenity BDD](https://www.baeldung.com/serenity-bdd)
+- [Introduction to JSONassert](https://www.baeldung.com/jsonassert)
+- [Serenity BDD and Screenplay](https://www.baeldung.com/serenity-screenplay)
+- [Serenity BDD with Spring and JBehave](https://www.baeldung.com/serenity-spring-jbehave)
+- [Introduction to Awaitlity](https://www.baeldung.com/awaitlity-testing)
+- [Introduction to Hoverfly in Java](https://www.baeldung.com/hoverfly)
+- [Testing with Hamcrest](https://www.baeldung.com/java-junit-hamcrest-guide)
diff --git a/libraries-testing/pom.xml b/libraries-testing/pom.xml
index 7cc5a8f775..a2fbed31b2 100644
--- a/libraries-testing/pom.xml
+++ b/libraries-testing/pom.xml
@@ -43,6 +43,12 @@
serenity-rest-assured${serenity.version}test
+
+
+ io.rest-assured
+ rest-assured
+
+ net.serenity-bdd
@@ -162,15 +168,15 @@
- 1.9.26
- 1.41.0
+ 1.9.9
+ 1.9.01.9.01.9.271.5.03.0.00.8.14.3.8.RELEASE
- 3.0.3
+ 4.1.13.6.22.0.0.0
diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/Animal.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/Animal.java
index 1a0266f5a3..1d37eef59b 100644
--- a/libraries-testing/src/test/java/com/baeldung/hamcrest/Animal.java
+++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/Animal.java
@@ -1,4 +1,4 @@
-package org.baeldung.hamcrest;
+package com.baeldung.hamcrest;
public class Animal {
String name;
diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/Cat.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/Cat.java
index 892e5b6e30..b15a3628da 100644
--- a/libraries-testing/src/test/java/com/baeldung/hamcrest/Cat.java
+++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/Cat.java
@@ -1,4 +1,4 @@
-package org.baeldung.hamcrest;
+package com.baeldung.hamcrest;
public class Cat extends Animal {
diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/HamcrestMatcherUnitTest.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/HamcrestMatcherUnitTest.java
index cf9fde7114..f5887ba79b 100644
--- a/libraries-testing/src/test/java/com/baeldung/hamcrest/HamcrestMatcherUnitTest.java
+++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/HamcrestMatcherUnitTest.java
@@ -1,10 +1,10 @@
-package org.baeldung.hamcrest;
+package com.baeldung.hamcrest;
import org.junit.Test;
import java.util.*;
-import static org.baeldung.hamcrest.IsPositiveInteger.isAPositiveInteger;
+import static com.baeldung.hamcrest.IsPositiveInteger.isAPositiveInteger;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.beans.HasProperty.hasProperty;
diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/IsPositiveInteger.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/IsPositiveInteger.java
index 0d8d262538..4d2ef8a8e5 100644
--- a/libraries-testing/src/test/java/com/baeldung/hamcrest/IsPositiveInteger.java
+++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/IsPositiveInteger.java
@@ -1,4 +1,4 @@
-package org.baeldung.hamcrest;
+package com.baeldung.hamcrest;
import org.hamcrest.Description;
import org.hamcrest.Factory;
diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/Person.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/Person.java
index 0053c98043..417daa866e 100644
--- a/libraries-testing/src/test/java/com/baeldung/hamcrest/Person.java
+++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/Person.java
@@ -1,4 +1,4 @@
-package org.baeldung.hamcrest;
+package com.baeldung.hamcrest;
public class Person {
String name;
diff --git a/libraries/README.md b/libraries/README.md
index 45713b6b45..7c7cf74211 100644
--- a/libraries/README.md
+++ b/libraries/README.md
@@ -1,39 +1,39 @@
### Relevant articles
-- [Introduction to Javatuples](http://www.baeldung.com/java-tuples)
-- [Introduction to Javassist](http://www.baeldung.com/javassist)
-- [Introduction to Apache Flink with Java](http://www.baeldung.com/apache-flink)
-- [Intro to JaVers](http://www.baeldung.com/javers)
-- [Merging Streams in Java](http://www.baeldung.com/java-merge-streams)
-- [Introduction to Quartz](http://www.baeldung.com/quartz)
-- [How to Warm Up the JVM](http://www.baeldung.com/java-jvm-warmup)
-- [Software Transactional Memory in Java Using Multiverse](http://www.baeldung.com/java-multiverse-stm)
-- [Locality-Sensitive Hashing in Java Using Java-LSH](http://www.baeldung.com/locality-sensitive-hashing)
-- [Introduction to Neuroph](http://www.baeldung.com/neuroph)
-- [Quick Guide to RSS with Rome](http://www.baeldung.com/rome-rss)
-- [Introduction to PCollections](http://www.baeldung.com/java-pcollections)
-- [Introduction to Eclipse Collections](http://www.baeldung.com/eclipse-collections)
-- [DistinctBy in the Java Stream API](http://www.baeldung.com/java-streams-distinct-by)
-- [Introduction to NoException](http://www.baeldung.com/no-exception)
-- [Spring Yarg Integration](http://www.baeldung.com/spring-yarg)
-- [Delete a Directory Recursively in Java](http://www.baeldung.com/java-delete-directory)
-- [Guide to JDeferred](http://www.baeldung.com/jdeferred)
-- [Introduction to MBassador](http://www.baeldung.com/mbassador)
-- [Using Pairs in Java](http://www.baeldung.com/java-pairs)
-- [Introduction to Caffeine](http://www.baeldung.com/java-caching-caffeine)
-- [Introduction to StreamEx](http://www.baeldung.com/streamex)
-- [A Docker Guide for Java](http://www.baeldung.com/docker-java-api)
-- [Introduction to Akka Actors in Java](http://www.baeldung.com/akka-actors-java)
-- [A Guide to Byte Buddy](http://www.baeldung.com/byte-buddy)
-- [Introduction to jOOL](http://www.baeldung.com/jool)
-- [Consumer Driven Contracts with Pact](http://www.baeldung.com/pact-junit-consumer-driven-contracts)
-- [Introduction to Atlassian Fugue](http://www.baeldung.com/java-fugue)
-- [Publish and Receive Messages with Nats Java Client](http://www.baeldung.com/nats-java-client)
-- [Java Concurrency Utility with JCTools](http://www.baeldung.com/java-concurrency-jc-tools)
-- [Introduction to JavaPoet](http://www.baeldung.com/java-poet)
-- [Guide to Resilience4j](http://www.baeldung.com/resilience4j)
+- [Introduction to Javatuples](https://www.baeldung.com/java-tuples)
+- [Introduction to Javassist](https://www.baeldung.com/javassist)
+- [Introduction to Apache Flink with Java](https://www.baeldung.com/apache-flink)
+- [Intro to JaVers](https://www.baeldung.com/javers)
+- [Merging Streams in Java](https://www.baeldung.com/java-merge-streams)
+- [Introduction to Quartz](https://www.baeldung.com/quartz)
+- [How to Warm Up the JVM](https://www.baeldung.com/java-jvm-warmup)
+- [Software Transactional Memory in Java Using Multiverse](https://www.baeldung.com/java-multiverse-stm)
+- [Locality-Sensitive Hashing in Java Using Java-LSH](https://www.baeldung.com/locality-sensitive-hashing)
+- [Introduction to Neuroph](https://www.baeldung.com/neuroph)
+- [Quick Guide to RSS with Rome](https://www.baeldung.com/rome-rss)
+- [Introduction to PCollections](https://www.baeldung.com/java-pcollections)
+- [Introduction to Eclipse Collections](https://www.baeldung.com/eclipse-collections)
+- [DistinctBy in the Java Stream API](https://www.baeldung.com/java-streams-distinct-by)
+- [Introduction to NoException](https://www.baeldung.com/no-exception)
+- [Spring Yarg Integration](https://www.baeldung.com/spring-yarg)
+- [Delete a Directory Recursively in Java](https://www.baeldung.com/java-delete-directory)
+- [Guide to JDeferred](https://www.baeldung.com/jdeferred)
+- [Introduction to MBassador](https://www.baeldung.com/mbassador)
+- [Using Pairs in Java](https://www.baeldung.com/java-pairs)
+- [Introduction to Caffeine](https://www.baeldung.com/java-caching-caffeine)
+- [Introduction to StreamEx](https://www.baeldung.com/streamex)
+- [A Docker Guide for Java](https://www.baeldung.com/docker-java-api)
+- [Introduction to Akka Actors in Java](https://www.baeldung.com/akka-actors-java)
+- [A Guide to Byte Buddy](https://www.baeldung.com/byte-buddy)
+- [Introduction to jOOL](https://www.baeldung.com/jool)
+- [Consumer Driven Contracts with Pact](https://www.baeldung.com/pact-junit-consumer-driven-contracts)
+- [Introduction to Atlassian Fugue](https://www.baeldung.com/java-fugue)
+- [Publish and Receive Messages with Nats Java Client](https://www.baeldung.com/nats-java-client)
+- [Java Concurrency Utility with JCTools](https://www.baeldung.com/java-concurrency-jc-tools)
+- [Introduction to JavaPoet](https://www.baeldung.com/java-poet)
+- [Guide to Resilience4j](https://www.baeldung.com/resilience4j)
- [Exactly Once Processing in Kafka](https://www.baeldung.com/kafka-exactly-once)
-- [Implementing a FTP-Client in Java](http://www.baeldung.com/java-ftp-client)
+- [Implementing a FTP-Client in Java](https://www.baeldung.com/java-ftp-client)
- [Introduction to Functional Java](https://www.baeldung.com/java-functional-library)
- [A Guide to the Reflections Library](https://www.baeldung.com/reflections-library)
diff --git a/linkrest/README.md b/linkrest/README.md
index 33cf930b18..8297b14bb5 100644
--- a/linkrest/README.md
+++ b/linkrest/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [Guide to LinkRest](http://www.baeldung.com/linkrest)
+- [Guide to LinkRest](https://www.baeldung.com/linkrest)
diff --git a/linux-bash/text/src/main/bash/remove_characters.sh b/linux-bash/text/src/main/bash/remove_characters.sh
new file mode 100755
index 0000000000..a8f51468f4
--- /dev/null
+++ b/linux-bash/text/src/main/bash/remove_characters.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+my_var="Hola Mundo"
+echo ${my_var}
+
+my_filename="interesting-text-file.txt"
+echo ${my_filename:0:21}
+
+echo ${my_filename%.*}
+
+complicated_filename="hello-world.tar.gz"
+echo ${complicated_filename%%.*}
+
+echo ${my_filename/.*/}
+
+echo 'interesting-text-file.txt' | sed 's/.txt*//'
+
+echo 'interesting-text-file.txt' | cut -f1 -d"."
+echo ${complicated_filename} | cut -f1 -d"."
diff --git a/logging-modules/README.md b/logging-modules/README.md
index 17405847b1..f5a1acaac1 100644
--- a/logging-modules/README.md
+++ b/logging-modules/README.md
@@ -3,5 +3,5 @@
### Relevant Articles:
-- [Creating a Custom Logback Appender](http://www.baeldung.com/custom-logback-appender)
-- [A Guide To Logback](http://www.baeldung.com/logback)
+- [Creating a Custom Logback Appender](https://www.baeldung.com/custom-logback-appender)
+- [A Guide To Logback](https://www.baeldung.com/logback)
diff --git a/logging-modules/flogger/pom.xml b/logging-modules/flogger/pom.xml
new file mode 100644
index 0000000000..0bba719616
--- /dev/null
+++ b/logging-modules/flogger/pom.xml
@@ -0,0 +1,66 @@
+
+
+
+ logging-modules
+ com.baeldung
+ 1.0.0-SNAPSHOT
+
+ 4.0.0
+
+ flogger
+
+
+
+ com.google.flogger
+ flogger
+ 0.4
+
+
+
+ com.google.flogger
+ flogger-system-backend
+ 0.4
+ runtime
+
+
+
+ com.google.flogger
+ flogger-slf4j-backend
+ 0.4
+
+
+
+ com.google.flogger
+ flogger-log4j-backend
+ 0.4
+
+
+ com.sun.jmx
+ jmxri
+
+
+ com.sun.jdmk
+ jmxtools
+
+
+ javax.jms
+ jms
+
+
+
+
+
+ log4j
+ log4j
+ 1.2.17
+
+
+ log4j
+ apache-log4j-extras
+ 1.2.17
+
+
+
+
\ No newline at end of file
diff --git a/logging-modules/flogger/src/main/java/com/baeldung/flogger/FloggerExamples.java b/logging-modules/flogger/src/main/java/com/baeldung/flogger/FloggerExamples.java
new file mode 100644
index 0000000000..252d2d38e4
--- /dev/null
+++ b/logging-modules/flogger/src/main/java/com/baeldung/flogger/FloggerExamples.java
@@ -0,0 +1,17 @@
+package com.baeldung.flogger;
+
+import com.google.common.flogger.FluentLogger;
+import com.google.common.flogger.LoggerConfig;
+
+import java.util.logging.Level;
+
+public class FloggerExamples {
+
+ private static final FluentLogger logger = FluentLogger.forEnclosingClass();
+
+ public static void main(String[] args) {
+ LoggerConfig.of(logger).setLevel(Level.FINE);
+ Exception exception = new Exception("This is a test exception.");
+ logger.atInfo().withCause(exception).log("Log message with: %s", "Alfred");
+ }
+}
diff --git a/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java b/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java
new file mode 100644
index 0000000000..80fa0edd96
--- /dev/null
+++ b/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java
@@ -0,0 +1,96 @@
+package com.baeldung.flogger;
+
+import com.google.common.flogger.FluentLogger;
+import com.google.common.flogger.LoggerConfig;
+import com.google.common.flogger.StackSize;
+import org.junit.Test;
+
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.stream.IntStream;
+
+import static com.google.common.flogger.LazyArgs.lazy;
+
+public class FloggerIntegrationTest {
+ static {
+// System.setProperty("flogger.backend_factory", "com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance");
+ System.setProperty("flogger.backend_factory", "com.google.common.flogger.backend.slf4j.Slf4jBackendFactory#getInstance");
+ }
+ private static final FluentLogger logger = FluentLogger.forEnclosingClass();
+
+ @Test
+ public void givenAnInterval_shouldLogAfterEveryInterval() {
+ IntStream.range(0, 100).forEach(value -> {
+ logger.atInfo().every(40).log("This log shows [every 40 iterations] => %d", value);
+ });
+ }
+
+ @Test
+ public void givenATimeInterval_shouldLogAfterEveryTimeInterval() {
+ IntStream.range(0, 1_000_0000).forEach(value -> {
+ logger.atInfo().atMostEvery(10, TimeUnit.SECONDS).log("This log shows [every 10 seconds] => %d", value);
+ });
+ }
+
+ @Test
+ public void givenAnObject_shouldLogTheObject() {
+ User user = new User();
+ logger.atInfo().log("The user is: %s", user); //correct
+
+ //The following ways of logging are not recommended
+ logger.atInfo().log("The user is: %s", user.toString());
+ logger.atInfo().log("The user is: %s" + user);
+ }
+
+ @Test
+ public void givenASimpleOperation_shouldLogTheResult() {
+ int result = 45 / 3;
+ logger.atInfo().log("The result is %d", result);
+ }
+
+ @Test
+ public void givenCodeThatThrowsAndException_shouldLogTheException() {
+ try {
+ int result = 45 / 0;
+ } catch (RuntimeException re) {
+ logger.atInfo().withStackTrace(StackSize.FULL).withCause(re).log("Message");
+ }
+ }
+
+ @Test
+ public void givenALoggingConfiguration_shouldLogAtTheConfiguredLevel() {
+ LoggerConfig.of(logger).setLevel(Level.FINE);
+ logger.atInfo().log("Info Message");
+ logger.atWarning().log("Warning Message");
+ logger.atSevere().log("Severe Message");
+ logger.atFinest().log("Finest Message");
+ logger.atFine().log("Fine Message");
+ logger.atFiner().log("Finer Message");
+ logger.atConfig().log("Config Message");
+ }
+
+ @Test
+ public void givenALongRunningMethodForStats_shouldCallTheMethodLazily() {
+ //Wrong way of doing it
+ logger.atFine().log("stats=%s", collectSummaries());
+
+ // Almost no work done at the log site and structure is preserved.
+ logger.atFine().log("stats=%s", lazy(() -> collectSummaries()));
+ }
+
+ public static String collectSummaries() {
+ //compute summaries in a long-running process
+ int items = 110;
+ int s = 30;
+ return String.format("%d seconds elapsed so far. %d items pending processing", s, items);
+ }
+
+ private class User {
+ String name = "Test";
+
+ @Override
+ public String toString() {
+ return name;
+ }
+ }
+}
diff --git a/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2ComparisonSysout.java b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2ComparisonSysout.java
new file mode 100644
index 0000000000..53592082b6
--- /dev/null
+++ b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2ComparisonSysout.java
@@ -0,0 +1,18 @@
+package com.baeldung.logging.log4j2;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintStream;
+
+public class Log4j2ComparisonSysout {
+
+ public static void main(String[] args) throws FileNotFoundException {
+ PrintStream outStream = new PrintStream(new File("outFile.txt"));
+ System.setOut(outStream);
+ System.out.println("This is a baeldung article");
+
+ PrintStream errStream = new PrintStream(new File("errFile.txt"));
+ System.setErr(errStream);
+ System.err.println("This is a baeldung article error");
+ }
+}
diff --git a/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2Example.java b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2Example.java
new file mode 100644
index 0000000000..b870924cf3
--- /dev/null
+++ b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2Example.java
@@ -0,0 +1,19 @@
+package com.baeldung.logging.log4j2;
+
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+
+public class Log4j2Example {
+
+ private static final Logger logger = LogManager.getLogger(Log4j2Example.class);
+
+ public static void main(String[] args) {
+ logger.debug("Debug log message");
+ logger.info("Info log message");
+ logger.error("Error log message");
+ logger.warn("Warn log message");
+ logger.fatal("Fatal log message");
+ logger.trace("Trace log message");
+ }
+
+}
diff --git a/logging-modules/log4j2/src/test/resources/log4j2.xml b/logging-modules/log4j2/src/test/resources/log4j2.xml
index 246ffb0707..ee26bcecf2 100644
--- a/logging-modules/log4j2/src/test/resources/log4j2.xml
+++ b/logging-modules/log4j2/src/test/resources/log4j2.xml
@@ -5,8 +5,7 @@
-
+
diff --git a/logging-modules/pom.xml b/logging-modules/pom.xml
index a303e50ff1..927afb6ca9 100644
--- a/logging-modules/pom.xml
+++ b/logging-modules/pom.xml
@@ -18,6 +18,7 @@
log4j2logbacklog-mdc
+ flogger
diff --git a/lombok/README.md b/lombok/README.md
index 4ff7ca7921..54a0984159 100644
--- a/lombok/README.md
+++ b/lombok/README.md
@@ -1,6 +1,6 @@
## Relevant Articles:
-- [Introduction to Project Lombok](http://www.baeldung.com/intro-to-project-lombok)
-- [Using Lombok’s @Builder Annotation](http://www.baeldung.com/lombok-builder)
+- [Introduction to Project Lombok](https://www.baeldung.com/intro-to-project-lombok)
+- [Using Lombok’s @Builder Annotation](https://www.baeldung.com/lombok-builder)
- [Using Lombok’s @Getter for Boolean Fields](https://www.baeldung.com/lombok-getter-boolean)
- [Lombok @Builder with Inheritance](https://www.baeldung.com/lombok-builder-inheritance)
- [Lombok Builder with Default Value](https://www.baeldung.com/lombok-builder-default-value)
diff --git a/lucene/README.md b/lucene/README.md
index ea7f715480..2bfd8bf4e1 100644
--- a/lucene/README.md
+++ b/lucene/README.md
@@ -1,5 +1,5 @@
### Relevant Articles:
-- [Introduction to Apache Lucene](http://www.baeldung.com/lucene)
-- [A Simple File Search with Lucene](http://www.baeldung.com/lucene-file-search)
+- [Introduction to Apache Lucene](https://www.baeldung.com/lucene)
+- [A Simple File Search with Lucene](https://www.baeldung.com/lucene-file-search)
- [Guide to Lucene Analyzers](https://www.baeldung.com/lucene-analyzers)
diff --git a/mapstruct/README.md b/mapstruct/README.md
index e279a48f7a..92c55a131d 100644
--- a/mapstruct/README.md
+++ b/mapstruct/README.md
@@ -1,2 +1,2 @@
###Relevant Articles:
-- [Quick Guide to MapStruct](http://www.baeldung.com/mapstruct)
+- [Quick Guide to MapStruct](https://www.baeldung.com/mapstruct)
diff --git a/mapstruct/pom.xml b/mapstruct/pom.xml
index 2613dcf083..e98c4a318b 100644
--- a/mapstruct/pom.xml
+++ b/mapstruct/pom.xml
@@ -35,6 +35,12 @@
lombok${org.projectlombok.version}
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
@@ -70,6 +76,7 @@
1.81.81.18.4
+ 3.11.1
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/CarDTO.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/CarDTO.java
new file mode 100644
index 0000000000..8f324f5a15
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/CarDTO.java
@@ -0,0 +1,23 @@
+package com.baeldung.unmappedproperties.dto;
+
+public class CarDTO {
+ private int id;
+ private String name;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/DocumentDTO.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/DocumentDTO.java
new file mode 100644
index 0000000000..8df306eb13
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/DocumentDTO.java
@@ -0,0 +1,52 @@
+package com.baeldung.unmappedproperties.dto;
+
+import java.util.List;
+
+public class DocumentDTO {
+ private int id;
+ private String title;
+ private String text;
+ private List comments;
+ private String author;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public List getComments() {
+ return comments;
+ }
+
+ public void setComments(List comments) {
+ this.comments = comments;
+ }
+
+ public String getAuthor() {
+ return author;
+ }
+
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+
+}
\ No newline at end of file
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Car.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Car.java
new file mode 100644
index 0000000000..c23ced3a6a
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Car.java
@@ -0,0 +1,23 @@
+package com.baeldung.unmappedproperties.entity;
+
+public class Car {
+ private int id;
+ private String name;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Document.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Document.java
new file mode 100644
index 0000000000..89457133a3
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Document.java
@@ -0,0 +1,42 @@
+package com.baeldung.unmappedproperties.entity;
+
+import java.util.Date;
+
+public class Document {
+ private int id;
+ private String title;
+ private String text;
+ private Date modificationTime;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public Date getModificationTime() {
+ return modificationTime;
+ }
+
+ public void setModificationTime(Date modificationTime) {
+ this.modificationTime = modificationTime;
+ }
+}
\ No newline at end of file
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/CarMapper.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/CarMapper.java
new file mode 100644
index 0000000000..714301b811
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/CarMapper.java
@@ -0,0 +1,13 @@
+package com.baeldung.unmappedproperties.mapper;
+
+import com.baeldung.unmappedproperties.dto.CarDTO;
+import com.baeldung.unmappedproperties.entity.Car;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+@Mapper
+public interface CarMapper {
+ CarMapper INSTANCE = Mappers.getMapper(CarMapper.class);
+
+ CarDTO carToCarDTO(Car car);
+}
\ No newline at end of file
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapper.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapper.java
new file mode 100644
index 0000000000..fe233ed172
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapper.java
@@ -0,0 +1,16 @@
+package com.baeldung.unmappedproperties.mapper;
+
+import com.baeldung.unmappedproperties.dto.DocumentDTO;
+import com.baeldung.unmappedproperties.entity.Document;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+@Mapper
+public interface DocumentMapper {
+
+ DocumentMapper INSTANCE = Mappers.getMapper(DocumentMapper.class);
+
+ DocumentDTO documentToDocumentDTO(Document entity);
+
+ Document documentDTOToDocument(DocumentDTO dto);
+}
\ No newline at end of file
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperMappingIgnore.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperMappingIgnore.java
new file mode 100644
index 0000000000..bf3b0b49c4
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperMappingIgnore.java
@@ -0,0 +1,20 @@
+package com.baeldung.unmappedproperties.mapper;
+
+import com.baeldung.unmappedproperties.dto.DocumentDTO;
+import com.baeldung.unmappedproperties.entity.Document;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.factory.Mappers;
+
+@Mapper
+public interface DocumentMapperMappingIgnore {
+
+ DocumentMapperMappingIgnore INSTANCE = Mappers.getMapper(DocumentMapperMappingIgnore.class);
+
+ @Mapping(target = "comments", ignore = true)
+ DocumentDTO documentToDocumentDTO(Document entity);
+
+ @Mapping(target = "modificationTime", ignore = true)
+ Document documentDTOToDocument(DocumentDTO dto);
+
+}
\ No newline at end of file
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperUnmappedPolicy.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperUnmappedPolicy.java
new file mode 100644
index 0000000000..b44f714774
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperUnmappedPolicy.java
@@ -0,0 +1,17 @@
+package com.baeldung.unmappedproperties.mapper;
+
+import com.baeldung.unmappedproperties.dto.DocumentDTO;
+import com.baeldung.unmappedproperties.entity.Document;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface DocumentMapperUnmappedPolicy {
+
+ DocumentMapperUnmappedPolicy INSTANCE = Mappers.getMapper(DocumentMapperUnmappedPolicy.class);
+
+ DocumentDTO documentToDocumentDTO(Document entity);
+
+ Document documentDTOToDocument(DocumentDTO dto);
+}
\ No newline at end of file
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperWithConfig.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperWithConfig.java
new file mode 100644
index 0000000000..dfaab7e1a1
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperWithConfig.java
@@ -0,0 +1,16 @@
+package com.baeldung.unmappedproperties.mapper;
+
+import com.baeldung.unmappedproperties.dto.DocumentDTO;
+import com.baeldung.unmappedproperties.entity.Document;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(config = IgnoreUnmappedMapperConfig.class)
+public interface DocumentMapperWithConfig {
+
+ DocumentMapperWithConfig INSTANCE = Mappers.getMapper(DocumentMapperWithConfig.class);
+
+ DocumentDTO documentToDocumentDTO(Document entity);
+
+ Document documentDTOToDocument(DocumentDTO dto);
+}
\ No newline at end of file
diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/IgnoreUnmappedMapperConfig.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/IgnoreUnmappedMapperConfig.java
new file mode 100644
index 0000000000..804ce9c03a
--- /dev/null
+++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/IgnoreUnmappedMapperConfig.java
@@ -0,0 +1,8 @@
+package com.baeldung.unmappedproperties.mapper;
+
+import org.mapstruct.MapperConfig;
+import org.mapstruct.ReportingPolicy;
+
+@MapperConfig(unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface IgnoreUnmappedMapperConfig {
+}
\ No newline at end of file
diff --git a/mapstruct/src/test/java/com/baeldung/mapper/DeliveryAddressMapperUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/DeliveryAddressMapperUnitTest.java
index e2c12fcba3..7d1e432546 100644
--- a/mapstruct/src/test/java/com/baeldung/mapper/DeliveryAddressMapperUnitTest.java
+++ b/mapstruct/src/test/java/com/baeldung/mapper/DeliveryAddressMapperUnitTest.java
@@ -17,48 +17,51 @@ public class DeliveryAddressMapperUnitTest {
@Test
public void testGivenCustomerAndAddress_mapsToDeliveryAddress() {
- // given
+ // given a customer
Customer customer = new Customer().setFirstName("Max")
.setLastName("Powers");
+ // and some address
Address homeAddress = new Address().setStreet("123 Some Street")
.setCounty("Nevada")
.setPostalcode("89123");
- // when
+ // when calling DeliveryAddressMapper::from
DeliveryAddress deliveryAddress = deliveryAddressMapper.from(customer, homeAddress);
- // then
+ // then a new DeliveryAddress is created, based on the given customer and his home address
assertEquals(deliveryAddress.getForename(), customer.getFirstName());
assertEquals(deliveryAddress.getSurname(), customer.getLastName());
assertEquals(deliveryAddress.getStreet(), homeAddress.getStreet());
assertEquals(deliveryAddress.getCounty(), homeAddress.getCounty());
assertEquals(deliveryAddress.getPostalcode(), homeAddress.getPostalcode());
+
}
@Test
public void testGivenDeliveryAddressAndSomeOtherAddress_updatesDeliveryAddress() {
- // given
- Customer customer = new Customer().setFirstName("Max")
- .setLastName("Powers");
-
- DeliveryAddress deliveryAddress = new DeliveryAddress().setStreet("123 Some Street")
+ // given a delivery address
+ DeliveryAddress deliveryAddress = new DeliveryAddress().setForename("Max")
+ .setSurname("Powers")
+ .setStreet("123 Some Street")
.setCounty("Nevada")
.setPostalcode("89123");
- Address otherAddress = new Address().setStreet("456 Some other street")
+ // and some new address
+ Address newAddress = new Address().setStreet("456 Some other street")
.setCounty("Arizona")
.setPostalcode("12345");
- // when
- DeliveryAddress updatedDeliveryAddress = deliveryAddressMapper.updateAddress(deliveryAddress, otherAddress);
+ // when calling DeliveryAddressMapper::updateAddress
+ DeliveryAddress updatedDeliveryAddress = deliveryAddressMapper.updateAddress(deliveryAddress, newAddress);
- // then
+ // then the *existing* delivery address is updated
assertSame(deliveryAddress, updatedDeliveryAddress);
- assertEquals(deliveryAddress.getStreet(), otherAddress.getStreet());
- assertEquals(deliveryAddress.getCounty(), otherAddress.getCounty());
- assertEquals(deliveryAddress.getPostalcode(), otherAddress.getPostalcode());
+ assertEquals(deliveryAddress.getStreet(), newAddress.getStreet());
+ assertEquals(deliveryAddress.getCounty(), newAddress.getCounty());
+ assertEquals(deliveryAddress.getPostalcode(), newAddress.getPostalcode());
+
}
}
diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/CarMapperUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/CarMapperUnitTest.java
new file mode 100644
index 0000000000..4ce04015f1
--- /dev/null
+++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/CarMapperUnitTest.java
@@ -0,0 +1,23 @@
+package com.baeldung.mapper.unmappedproperties;
+
+import com.baeldung.unmappedproperties.dto.CarDTO;
+import com.baeldung.unmappedproperties.entity.Car;
+import com.baeldung.unmappedproperties.mapper.CarMapper;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class CarMapperUnitTest {
+
+ @Test
+ public void givenCarEntitytoCar_whenMaps_thenCorrect() {
+ Car entity = new Car();
+ entity.setId(1);
+ entity.setName("Toyota");
+
+ CarDTO carDto = CarMapper.INSTANCE.carToCarDTO(entity);
+
+ assertThat(carDto.getId()).isEqualTo(entity.getId());
+ assertThat(carDto.getName()).isEqualTo(entity.getName());
+ }
+}
diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperMappingIgnoreUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperMappingIgnoreUnitTest.java
new file mode 100644
index 0000000000..493c7f8686
--- /dev/null
+++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperMappingIgnoreUnitTest.java
@@ -0,0 +1,45 @@
+package com.baeldung.mapper.unmappedproperties;
+
+import com.baeldung.unmappedproperties.dto.DocumentDTO;
+import com.baeldung.unmappedproperties.entity.Document;
+import com.baeldung.unmappedproperties.mapper.DocumentMapperMappingIgnore;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Date;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class DocumentMapperMappingIgnoreUnitTest {
+
+ @Test
+ public void givenDocumentEntityToDocumentDto_whenMaps_thenCorrect() {
+ Document entity = new Document();
+ entity.setId(1);
+ entity.setTitle("Price 13-42");
+ entity.setText("List of positions.......");
+ entity.setModificationTime(new Date());
+
+ DocumentDTO dto = DocumentMapperMappingIgnore.INSTANCE.documentToDocumentDTO(entity);
+
+ assertThat(dto.getId()).isEqualTo(entity.getId());
+ assertThat(dto.getTitle()).isEqualTo(entity.getTitle());
+ assertThat(dto.getText()).isEqualTo(entity.getText());
+ }
+
+ @Test
+ public void givenDocumentDtoToDocumentEntity_whenMaps_thenCorrect() {
+ DocumentDTO dto = new DocumentDTO();
+ dto.setId(1);
+ dto.setTitle("Price 13-42");
+ dto.setText("List of positions.......");
+ dto.setComments(Arrays.asList("Not all positions", "Wrong price values"));
+ dto.setAuthor("Author1");
+
+ Document entity = DocumentMapperMappingIgnore.INSTANCE.documentDTOToDocument(dto);
+
+ assertThat(entity.getId()).isEqualTo(dto.getId());
+ assertThat(entity.getTitle()).isEqualTo(dto.getTitle());
+ assertThat(entity.getText()).isEqualTo(dto.getText());
+ }
+}
\ No newline at end of file
diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnitTest.java
new file mode 100644
index 0000000000..1d3645ca96
--- /dev/null
+++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnitTest.java
@@ -0,0 +1,45 @@
+package com.baeldung.mapper.unmappedproperties;
+
+import com.baeldung.unmappedproperties.dto.DocumentDTO;
+import com.baeldung.unmappedproperties.entity.Document;
+import com.baeldung.unmappedproperties.mapper.DocumentMapper;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Date;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class DocumentMapperUnitTest {
+
+ @Test
+ public void givenDocumentEntityToDocumentDto_whenMaps_thenCorrect() {
+ Document entity = new Document();
+ entity.setId(1);
+ entity.setTitle("Price 13-42");
+ entity.setText("List of positions.......");
+ entity.setModificationTime(new Date());
+
+ DocumentDTO dto = DocumentMapper.INSTANCE.documentToDocumentDTO(entity);
+
+ assertThat(dto.getId()).isEqualTo(entity.getId());
+ assertThat(dto.getTitle()).isEqualTo(entity.getTitle());
+ assertThat(dto.getText()).isEqualTo(entity.getText());
+ }
+
+ @Test
+ public void givenDocumentDtoToDocumentEntity_whenMaps_thenCorrect() {
+ DocumentDTO dto = new DocumentDTO();
+ dto.setId(1);
+ dto.setTitle("Price 13-42");
+ dto.setText("List of positions.......");
+ dto.setComments(Arrays.asList("Not all positions", "Wrong price values"));
+ dto.setAuthor("Author1");
+
+ Document entity = DocumentMapper.INSTANCE.documentDTOToDocument(dto);
+
+ assertThat(entity.getId()).isEqualTo(dto.getId());
+ assertThat(entity.getTitle()).isEqualTo(dto.getTitle());
+ assertThat(entity.getText()).isEqualTo(dto.getText());
+ }
+}
\ No newline at end of file
diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnmappedPolicyUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnmappedPolicyUnitTest.java
new file mode 100644
index 0000000000..f6666a52ec
--- /dev/null
+++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnmappedPolicyUnitTest.java
@@ -0,0 +1,45 @@
+package com.baeldung.mapper.unmappedproperties;
+
+import com.baeldung.unmappedproperties.dto.DocumentDTO;
+import com.baeldung.unmappedproperties.entity.Document;
+import com.baeldung.unmappedproperties.mapper.DocumentMapperUnmappedPolicy;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Date;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class DocumentMapperUnmappedPolicyUnitTest {
+
+ @Test
+ public void givenDocumentEntityToDocumentDto_whenMaps_thenCorrect() {
+ Document entity = new Document();
+ entity.setId(1);
+ entity.setTitle("Price 13-42");
+ entity.setText("List of positions.......");
+ entity.setModificationTime(new Date());
+
+ DocumentDTO dto = DocumentMapperUnmappedPolicy.INSTANCE.documentToDocumentDTO(entity);
+
+ assertThat(dto.getId()).isEqualTo(entity.getId());
+ assertThat(dto.getTitle()).isEqualTo(entity.getTitle());
+ assertThat(dto.getText()).isEqualTo(entity.getText());
+ }
+
+ @Test
+ public void givenDocumentDtoToDocumentEntity_whenMaps_thenCorrect() {
+ DocumentDTO dto = new DocumentDTO();
+ dto.setId(1);
+ dto.setTitle("Price 13-42");
+ dto.setText("List of positions.......");
+ dto.setComments(Arrays.asList("Not all positions", "Wrong price values"));
+ dto.setAuthor("Author1");
+
+ Document entity = DocumentMapperUnmappedPolicy.INSTANCE.documentDTOToDocument(dto);
+
+ assertThat(entity.getId()).isEqualTo(dto.getId());
+ assertThat(entity.getTitle()).isEqualTo(dto.getTitle());
+ assertThat(entity.getText()).isEqualTo(dto.getText());
+ }
+}
\ No newline at end of file
diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperWithConfigUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperWithConfigUnitTest.java
new file mode 100644
index 0000000000..c9409225f5
--- /dev/null
+++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperWithConfigUnitTest.java
@@ -0,0 +1,45 @@
+package com.baeldung.mapper.unmappedproperties;
+
+import com.baeldung.unmappedproperties.dto.DocumentDTO;
+import com.baeldung.unmappedproperties.entity.Document;
+import com.baeldung.unmappedproperties.mapper.DocumentMapperWithConfig;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Date;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class DocumentMapperWithConfigUnitTest {
+
+ @Test
+ public void givenDocumentEntityToDocumentDto_whenMaps_thenCorrect() {
+ Document entity = new Document();
+ entity.setId(1);
+ entity.setTitle("Price 13-42");
+ entity.setText("List of positions.......");
+ entity.setModificationTime(new Date());
+
+ DocumentDTO dto = DocumentMapperWithConfig.INSTANCE.documentToDocumentDTO(entity);
+
+ assertThat(dto.getId()).isEqualTo(entity.getId());
+ assertThat(dto.getTitle()).isEqualTo(entity.getTitle());
+ assertThat(dto.getText()).isEqualTo(entity.getText());
+ }
+
+ @Test
+ public void givenDocumentDtoToDocumentEntity_whenMaps_thenCorrect() {
+ DocumentDTO dto = new DocumentDTO();
+ dto.setId(1);
+ dto.setTitle("Price 13-42");
+ dto.setText("List of positions.......");
+ dto.setComments(Arrays.asList("Not all positions", "Wrong price values"));
+ dto.setAuthor("Author1");
+
+ Document entity = DocumentMapperWithConfig.INSTANCE.documentDTOToDocument(dto);
+
+ assertThat(entity.getId()).isEqualTo(dto.getId());
+ assertThat(entity.getTitle()).isEqualTo(dto.getTitle());
+ assertThat(entity.getText()).isEqualTo(dto.getText());
+ }
+}
\ No newline at end of file
diff --git a/maven-all/README.md b/maven-all/README.md
new file mode 100644
index 0000000000..d014f323d2
--- /dev/null
+++ b/maven-all/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles
+
+- [Apache Maven Tutorial](https://www.baeldung.com/maven)
\ No newline at end of file
diff --git a/maven-all/compiler-plugin-java-9/README.md b/maven-all/compiler-plugin-java-9/README.md
new file mode 100644
index 0000000000..d0b7b72acc
--- /dev/null
+++ b/maven-all/compiler-plugin-java-9/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles
+
+- [Maven Compiler Plugin](http://www.baeldung.com/maven-compiler-plugin)
\ No newline at end of file
diff --git a/maven/compiler-plugin-java-9/pom.xml b/maven-all/compiler-plugin-java-9/pom.xml
similarity index 100%
rename from maven/compiler-plugin-java-9/pom.xml
rename to maven-all/compiler-plugin-java-9/pom.xml
diff --git a/maven/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java b/maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java
similarity index 100%
rename from maven/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java
rename to maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java
diff --git a/maven/compiler-plugin-java-9/src/main/java/module-info.java b/maven-all/compiler-plugin-java-9/src/main/java/module-info.java
similarity index 100%
rename from maven/compiler-plugin-java-9/src/main/java/module-info.java
rename to maven-all/compiler-plugin-java-9/src/main/java/module-info.java
diff --git a/maven-all/maven-war-plugin/README.md b/maven-all/maven-war-plugin/README.md
new file mode 100644
index 0000000000..d559fea80b
--- /dev/null
+++ b/maven-all/maven-war-plugin/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles
+
+- [Eclipse Error: web.xml is missing and failOnMissingWebXml is set to true](https://www.baeldung.com/eclipse-error-web-xml-missing)
\ No newline at end of file
diff --git a/maven/maven-war-plugin/pom.xml b/maven-all/maven-war-plugin/pom.xml
similarity index 89%
rename from maven/maven-war-plugin/pom.xml
rename to maven-all/maven-war-plugin/pom.xml
index 517c08978f..25c2e1ba1b 100644
--- a/maven/maven-war-plugin/pom.xml
+++ b/maven-all/maven-war-plugin/pom.xml
@@ -1,29 +1,29 @@
-
- 4.0.0
- com.baeldung
- maven-war-plugin-property
- 0.0.1-SNAPSHOT
- war
- maven-war-plugin-property
-
-
-
-
- maven-war-plugin
-
- 3.1.0
-
-
- false
-
-
-
-
-
-
-
- false
-
+
+ 4.0.0
+ com.baeldung
+ maven-war-plugin
+ 0.0.1-SNAPSHOT
+ war
+ maven-war-plugin
+
+
+
+
+ maven-war-plugin
+
+ 3.1.0
+
+
+ false
+
+
+
+
+
+
+
+ false
+
\ No newline at end of file
diff --git a/maven/.gitignore b/maven-all/maven/.gitignore
similarity index 100%
rename from maven/.gitignore
rename to maven-all/maven/.gitignore
diff --git a/maven-all/maven/README.md b/maven-all/maven/README.md
new file mode 100644
index 0000000000..acf7dfc47b
--- /dev/null
+++ b/maven-all/maven/README.md
@@ -0,0 +1,14 @@
+### Relevant Articles
+
+- [Guide to the Core Maven Plugins](https://www.baeldung.com/core-maven-plugins)
+- [Maven Resources Plugin](https://www.baeldung.com/maven-resources-plugin)
+- [Maven Compiler Plugin](https://www.baeldung.com/maven-compiler-plugin)
+- [Quick Guide to the Maven Surefire Plugin](https://www.baeldung.com/maven-surefire-plugin)
+- [The Maven Failsafe Plugin](https://www.baeldung.com/maven-failsafe-plugin)
+- [The Maven Verifier Plugin](https://www.baeldung.com/maven-verifier-plugin)
+- [The Maven Clean Plugin](https://www.baeldung.com/maven-clean-plugin)
+- [Build a Jar with Maven and Ignore the Test Results](https://www.baeldung.com/maven-ignore-test-results)
+- [Maven Project with Multiple Source Directories](https://www.baeldung.com/maven-project-multiple-src-directories)
+- [Integration Testing with Maven](https://www.baeldung.com/maven-integration-test)
+- [Apache Maven Standard Directory Layout](https://www.baeldung.com/maven-directory-structure)
+- [Multi-Module Project with Maven](https://www.baeldung.com/maven-multi-module)
diff --git a/maven/custom-rule/pom.xml b/maven-all/maven/custom-rule/pom.xml
similarity index 100%
rename from maven/custom-rule/pom.xml
rename to maven-all/maven/custom-rule/pom.xml
diff --git a/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java b/maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java
similarity index 100%
rename from maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java
rename to maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java
diff --git a/maven/input-resources/baeldung.png b/maven-all/maven/input-resources/baeldung.png
similarity index 100%
rename from maven/input-resources/baeldung.png
rename to maven-all/maven/input-resources/baeldung.png
diff --git a/maven/input-resources/baeldung.txt b/maven-all/maven/input-resources/baeldung.txt
similarity index 100%
rename from maven/input-resources/baeldung.txt
rename to maven-all/maven/input-resources/baeldung.txt
diff --git a/maven/input-resources/verifications.xml b/maven-all/maven/input-resources/verifications.xml
similarity index 100%
rename from maven/input-resources/verifications.xml
rename to maven-all/maven/input-resources/verifications.xml
diff --git a/maven-all/maven/maven-enforcer/README.md b/maven-all/maven/maven-enforcer/README.md
new file mode 100644
index 0000000000..7515647a3d
--- /dev/null
+++ b/maven-all/maven/maven-enforcer/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles
+
+- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin)
\ No newline at end of file
diff --git a/maven/maven-enforcer/pom.xml b/maven-all/maven/maven-enforcer/pom.xml
similarity index 100%
rename from maven/maven-enforcer/pom.xml
rename to maven-all/maven/maven-enforcer/pom.xml
diff --git a/maven/pom.xml b/maven-all/maven/pom.xml
similarity index 99%
rename from maven/pom.xml
rename to maven-all/maven/pom.xml
index ef6e7b7d93..d34be04fcf 100644
--- a/maven/pom.xml
+++ b/maven-all/maven/pom.xml
@@ -11,6 +11,7 @@
parent-modulescom.baeldung1.0.0-SNAPSHOT
+ ../..
diff --git a/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java b/maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java
similarity index 100%
rename from maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java
rename to maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java
diff --git a/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java b/maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java
similarity index 100%
rename from maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java
rename to maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java
diff --git a/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java b/maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java
similarity index 100%
rename from maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java
rename to maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java
diff --git a/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java b/maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java
similarity index 100%
rename from maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java
rename to maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java
diff --git a/maven/src/main/java/com/baeldung/maven/plugins/Data.java b/maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java
similarity index 100%
rename from maven/src/main/java/com/baeldung/maven/plugins/Data.java
rename to maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java
diff --git a/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java b/maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java
similarity index 100%
rename from maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java
rename to maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java
diff --git a/maven-all/maven/src/main/resources/logback.xml b/maven-all/maven/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/maven-all/maven/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/maven/src/main/webapp/WEB-INF/web.xml b/maven-all/maven/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from maven/src/main/webapp/WEB-INF/web.xml
rename to maven-all/maven/src/main/webapp/WEB-INF/web.xml
diff --git a/maven/src/test/java/com/baeldung/maven/it/Integration.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java
similarity index 100%
rename from maven/src/test/java/com/baeldung/maven/it/Integration.java
rename to maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java
diff --git a/maven/src/test/java/com/baeldung/maven/it/RestIT.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java
similarity index 100%
rename from maven/src/test/java/com/baeldung/maven/it/RestIT.java
rename to maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java
diff --git a/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java
similarity index 100%
rename from maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java
rename to maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java
diff --git a/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java
similarity index 100%
rename from maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java
rename to maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java
diff --git a/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java b/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java
similarity index 100%
rename from maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java
rename to maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java
diff --git a/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java b/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java
similarity index 100%
rename from maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java
rename to maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java
diff --git a/maven/src/test/java/testfail/TestFail.java b/maven-all/maven/src/test/java/testfail/TestFail.java
similarity index 100%
rename from maven/src/test/java/testfail/TestFail.java
rename to maven-all/maven/src/test/java/testfail/TestFail.java
diff --git a/maven-all/profiles/README.md b/maven-all/profiles/README.md
new file mode 100644
index 0000000000..22d5d7f70c
--- /dev/null
+++ b/maven-all/profiles/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles
+
+- [Guide to Maven Profiles](https://www.baeldung.com/maven-profiles)
\ No newline at end of file
diff --git a/maven/profiles/pom.xml b/maven-all/profiles/pom.xml
similarity index 100%
rename from maven/profiles/pom.xml
rename to maven-all/profiles/pom.xml
diff --git a/maven-all/versions-maven-plugin/README.md b/maven-all/versions-maven-plugin/README.md
new file mode 100644
index 0000000000..8f5670f802
--- /dev/null
+++ b/maven-all/versions-maven-plugin/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles
+
+- [Use the Latest Version of a Dependency in Maven](https://www.baeldung.com/maven-dependency-latest-version)
\ No newline at end of file
diff --git a/maven/versions-maven-plugin/original/pom.xml b/maven-all/versions-maven-plugin/original/pom.xml
similarity index 100%
rename from maven/versions-maven-plugin/original/pom.xml
rename to maven-all/versions-maven-plugin/original/pom.xml
diff --git a/maven/versions-maven-plugin/pom.xml b/maven-all/versions-maven-plugin/pom.xml
similarity index 98%
rename from maven/versions-maven-plugin/pom.xml
rename to maven-all/versions-maven-plugin/pom.xml
index e0714bf0e0..c9f63a46f1 100644
--- a/maven/versions-maven-plugin/pom.xml
+++ b/maven-all/versions-maven-plugin/pom.xml
@@ -36,7 +36,7 @@
commons-beanutilscommons-beanutils
- 1.9.1-SNAPSHOT
+ 1.9.1
diff --git a/maven/versions-maven-plugin/run-the-demo.sh b/maven-all/versions-maven-plugin/run-the-demo.sh
old mode 100755
new mode 100644
similarity index 100%
rename from maven/versions-maven-plugin/run-the-demo.sh
rename to maven-all/versions-maven-plugin/run-the-demo.sh
diff --git a/maven-archetype/README.md b/maven-archetype/README.md
index 71821e3348..b707150854 100644
--- a/maven-archetype/README.md
+++ b/maven-archetype/README.md
@@ -1,4 +1,4 @@
### Relevant Articles:
================================
-- [Guide to Maven Archetype](http://www.baeldung.com/maven-archetype)
+- [Guide to Maven Archetype](https://www.baeldung.com/maven-archetype)
diff --git a/maven/README.md b/maven/README.md
deleted file mode 100644
index 6d1a7081b7..0000000000
--- a/maven/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-### Relevant Articles
-
-- [Guide to the Core Maven Plugins](http://www.baeldung.com/core-maven-plugins)
-- [Maven Resources Plugin](http://www.baeldung.com/maven-resources-plugin)
-- [Maven Compiler Plugin](http://www.baeldung.com/maven-compiler-plugin)
-- [Quick Guide to the Maven Surefire Plugin](http://www.baeldung.com/maven-surefire-plugin)
-- [The Maven Failsafe Plugin](http://www.baeldung.com/maven-failsafe-plugin)
-- [The Maven Verifier Plugin](http://www.baeldung.com/maven-verifier-plugin)
-- [The Maven Clean Plugin](http://www.baeldung.com/maven-clean-plugin)
-- [Build a Jar with Maven and Ignore the Test Results](http://www.baeldung.com/maven-ignore-test-results)
-- [Maven Project with Multiple Source Directories](https://www.baeldung.com/maven-project-multiple-src-directories)
-- [Integration Testing with Maven](https://www.baeldung.com/maven-integration-test)
-- [Apache Maven Standard Directory Layout](https://www.baeldung.com/maven-directory-structure)
-- [Apache Maven Tutorial](https://www.baeldung.com/maven)
-- [Use the Latest Version of a Dependency in Maven](https://www.baeldung.com/maven-dependency-latest-version)
-- [Multi-Module Project with Maven](https://www.baeldung.com/maven-multi-module)
-- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin)
-- [Eclipse Error: web.xml is missing and failOnMissingWebXml is set to true](https://www.baeldung.com/eclipse-error-web-xml-missing)
-- [Guide to Maven Profiles](https://www.baeldung.com/maven-profiles)
diff --git a/mesos-marathon/README.md b/mesos-marathon/README.md
index 1d4d4995a8..09467ebfcb 100644
--- a/mesos-marathon/README.md
+++ b/mesos-marathon/README.md
@@ -1,5 +1,5 @@
### Relevant articles
-- [Simple Jenkins Pipeline with Marathon and Mesos](http://www.baeldung.com/jenkins-pipeline-with-marathon-mesos)
+- [Simple Jenkins Pipeline with Marathon and Mesos](https://www.baeldung.com/jenkins-pipeline-with-marathon-mesos)
To run the pipeline, please modify the dockerise.sh file with your own useranema and password for docker login.
diff --git a/metrics/README.md b/metrics/README.md
index c7772bffa0..d344a2707f 100644
--- a/metrics/README.md
+++ b/metrics/README.md
@@ -1,5 +1,5 @@
## Relevant articles:
-- [Intro to Dropwizard Metrics](http://www.baeldung.com/dropwizard-metrics)
-- [Introduction to Netflix Servo](http://www.baeldung.com/netflix-servo)
-- [Quick Guide to Micrometer](http://www.baeldung.com/micrometer)
+- [Intro to Dropwizard Metrics](https://www.baeldung.com/dropwizard-metrics)
+- [Introduction to Netflix Servo](https://www.baeldung.com/netflix-servo)
+- [Quick Guide to Micrometer](https://www.baeldung.com/micrometer)
diff --git a/micronaut/README.md b/micronaut/README.md
index 10a68ff2f8..0a39cf9e33 100644
--- a/micronaut/README.md
+++ b/micronaut/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Introduction to Micronaut Framework](http://www.baeldung.com/micronaut)
+- [Introduction to Micronaut Framework](https://www.baeldung.com/micronaut)
diff --git a/microprofile/README.md b/microprofile/README.md
index 1a28487e89..7525ee5bff 100644
--- a/microprofile/README.md
+++ b/microprofile/README.md
@@ -1,3 +1,3 @@
### Relevant articles:
-- [Building Microservices with Eclipse MicroProfile](http://www.baeldung.com/eclipse-microprofile)
+- [Building Microservices with Eclipse MicroProfile](https://www.baeldung.com/eclipse-microprofile)
diff --git a/ml/README.md b/ml/README.md
index f4712a94da..1362f2840c 100644
--- a/ml/README.md
+++ b/ml/README.md
@@ -2,4 +2,4 @@
This is a soft introduction to ML using [deeplearning4j](https://deeplearning4j.org) library
### Relevant Articles:
-- [Logistic Regression in Java](http://www.baeldung.com/)
+- [Logistic Regression in Java](https://www.baeldung.com/)
diff --git a/msf4j/README.md b/msf4j/README.md
index 7c66b8dc5f..b7f2c5a546 100644
--- a/msf4j/README.md
+++ b/msf4j/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [Introduction to Java Microservices with MSF4J](http://www.baeldung.com/msf4j)
+- [Introduction to Java Microservices with MSF4J](https://www.baeldung.com/msf4j)
diff --git a/muleesb/README.md b/muleesb/README.md
index 8da4e595e3..555a10b5cc 100644
--- a/muleesb/README.md
+++ b/muleesb/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [Getting Started With Mule ESB](http://www.baeldung.com/mule-esb)
+- [Getting Started With Mule ESB](https://www.baeldung.com/mule-esb)
diff --git a/mustache/README.md b/mustache/README.md
index fa41eb4f4d..c36080b56f 100644
--- a/mustache/README.md
+++ b/mustache/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [Introduction to Mustache](http://www.baeldung.com/mustache)
-- [Guide to Mustache with Spring Boot](http://www.baeldung.com/spring-boot-mustache)
+- [Introduction to Mustache](https://www.baeldung.com/mustache)
+- [Guide to Mustache with Spring Boot](https://www.baeldung.com/spring-boot-mustache)
diff --git a/mybatis/README.md b/mybatis/README.md
index 7c366aeab6..57687d3da1 100644
--- a/mybatis/README.md
+++ b/mybatis/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Quick Guide to MyBatis](http://www.baeldung.com/mybatis)
+- [Quick Guide to MyBatis](https://www.baeldung.com/mybatis)
diff --git a/orika/README.md b/orika/README.md
index 4ed033c170..0096793507 100644
--- a/orika/README.md
+++ b/orika/README.md
@@ -1,2 +1,2 @@
### Relevant Articles:
-- [Mapping with Orika](http://www.baeldung.com/orika-mapping)
+- [Mapping with Orika](https://www.baeldung.com/orika-mapping)
diff --git a/osgi/readme.md b/osgi/readme.md
index e380ae06c3..ee5d7d66c4 100644
--- a/osgi/readme.md
+++ b/osgi/readme.md
@@ -87,7 +87,7 @@ org.eclipse.osgi_3.12.1.v20170821-1548.jar
= = NOT GOOD = =
## Relevant articles:
- - [Introduction to OSGi](http://www.baeldung.com/osgi)
+ - [Introduction to OSGi](https://www.baeldung.com/osgi)
diff --git a/parent-boot-1/README.md b/parent-boot-1/README.md
index 8b312c348a..5ad14c6519 100644
--- a/parent-boot-1/README.md
+++ b/parent-boot-1/README.md
@@ -1,2 +1,3 @@
+## Parent Boot 1
This is a parent module for all projects using Spring Boot 1.
diff --git a/parent-boot-2/README.md b/parent-boot-2/README.md
index 3f18bdf38e..7afe447a66 100644
--- a/parent-boot-2/README.md
+++ b/parent-boot-2/README.md
@@ -1,2 +1,3 @@
+## Parent Boot 2
This is a parent module for all projects using Spring Boot 2.
diff --git a/parent-java/README.md b/parent-java/README.md
index 729105e3fd..1b14b7cfc1 100644
--- a/parent-java/README.md
+++ b/parent-java/README.md
@@ -1 +1,3 @@
-## Relevant Articles:
+## Parent Java
+
+This is a parent module for all projects using Java
\ No newline at end of file
diff --git a/parent-kotlin/README.md b/parent-kotlin/README.md
index 6c17a6ac29..c78ecbac42 100644
--- a/parent-kotlin/README.md
+++ b/parent-kotlin/README.md
@@ -1,2 +1,3 @@
+## Parent Kotlin
-Parent module for Kotlin projects.
+This is a parent module for all projects using Kotlin
diff --git a/parent-spring-4/README.md b/parent-spring-4/README.md
index 729105e3fd..f14d003dd5 100644
--- a/parent-spring-4/README.md
+++ b/parent-spring-4/README.md
@@ -1 +1,3 @@
-## Relevant Articles:
+## Parent Spring 4
+
+This is a parent module for all projects using Spring 4
diff --git a/parent-spring-5/README.md b/parent-spring-5/README.md
index 729105e3fd..791a6ca197 100644
--- a/parent-spring-5/README.md
+++ b/parent-spring-5/README.md
@@ -1 +1,3 @@
-## Relevant Articles:
+## Parent Spring 5
+
+This is a parent module for all projects using Spring 5
diff --git a/patterns/design-patterns-creational/README.md b/patterns/design-patterns-creational/README.md
index 0c00dc7b3a..99b9b39787 100644
--- a/patterns/design-patterns-creational/README.md
+++ b/patterns/design-patterns-creational/README.md
@@ -6,3 +6,4 @@
- [Double-Checked Locking with Singleton](https://www.baeldung.com/java-singleton-double-checked-locking)
- [Java Constructors vs Static Factory Methods](https://www.baeldung.com/java-constructors-vs-static-factory-methods)
- [Automatic Generation of the Builder Pattern with FreeBuilder](https://www.baeldung.com/java-builder-pattern-freebuilder)
+- [How to Replace Many if Statements in Java](https://www.baeldung.com/java-replace-if-statements)
\ No newline at end of file
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/AddCommand.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/AddCommand.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/AddRule.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/AddRule.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Addition.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Addition.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Addition.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Addition.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Calculator.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Calculator.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Command.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Command.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Division.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Division.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Division.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Division.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Expression.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Expression.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Expression.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Expression.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Modulo.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Modulo.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Modulo.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Modulo.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Multiplication.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Multiplication.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Multiplication.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Multiplication.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operation.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Operation.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operation.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Operation.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operator.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Operator.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operator.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Operator.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Result.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Result.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Result.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Result.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Rule.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Rule.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java
diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Subtraction.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Subtraction.java
similarity index 100%
rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Subtraction.java
rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Subtraction.java
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java b/patterns/design-patterns-creational/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java
rename to patterns/design-patterns-creational/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java
diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java b/patterns/design-patterns-creational/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java
similarity index 100%
rename from core-java-modules/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java
rename to patterns/design-patterns-creational/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java
diff --git a/patterns/dipmodular/README.md b/patterns/dipmodular/README.md
new file mode 100644
index 0000000000..ba46158b8c
--- /dev/null
+++ b/patterns/dipmodular/README.md
@@ -0,0 +1,3 @@
+## Relevant Articles:
+
+- [The Dependency Inversion Principle in Java](https://www.baeldung.com/java-dependency-inversion-principle)
diff --git a/pdf/README.md b/pdf/README.md
index 5454d2b2de..8525dc4f69 100644
--- a/pdf/README.md
+++ b/pdf/README.md
@@ -1,3 +1,3 @@
### Relevant Articles:
-- [PDF Conversions in Java](http://www.baeldung.com/pdf-conversions-java)
-- [Creating PDF Files in Java](http://www.baeldung.com/java-pdf-creation)
+- [PDF Conversions in Java](https://www.baeldung.com/pdf-conversions-java)
+- [Creating PDF Files in Java](https://www.baeldung.com/java-pdf-creation)
diff --git a/performance-tests/README.md b/performance-tests/README.md
index 0064157966..918c81bb69 100644
--- a/performance-tests/README.md
+++ b/performance-tests/README.md
@@ -1,10 +1,10 @@
### Relevant Articles:
-- [Performance of Java Mapping Frameworks](http://www.baeldung.com/java-performance-mapping-frameworks)
+- [Performance of Java Mapping Frameworks](https://www.baeldung.com/java-performance-mapping-frameworks)
### Running
To run the performance benchmarks:
1: `mvn clean install`
-2: `java -jar target/benchmarks.jar`
\ No newline at end of file
+2: `java -jar target/benchmarks.jar`
diff --git a/persistence-modules/hibernate-parameters/pom.xml b/persistence-modules/hibernate-parameters/pom.xml
new file mode 100644
index 0000000000..b744e181da
--- /dev/null
+++ b/persistence-modules/hibernate-parameters/pom.xml
@@ -0,0 +1,52 @@
+
+
+ 4.0.0
+ com.baeldung
+ hibernate-parameters
+ 0.1-SNAPSHOT
+ hibernate-parameters
+ jar
+ Hibernate tutorial illustrating the use of named parameters
+
+
+ com.baeldung
+ parent-modules
+ 1.0.0-SNAPSHOT
+ ../../
+
+
+
+
+ org.hibernate
+ hibernate-core
+ 5.4.4.Final
+
+
+
+ com.h2database
+ h2
+ 1.4.196
+
+
+
+
+
+
+ false
+ src/test/java
+
+ **/*.xml
+
+
+
+ src/test/resources
+
+
+
+
+
+ true
+
+
+
diff --git a/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.hbm.xml b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.hbm.xml
new file mode 100644
index 0000000000..4055718776
--- /dev/null
+++ b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.hbm.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.java b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.java
new file mode 100644
index 0000000000..f44b1bfd8a
--- /dev/null
+++ b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.java
@@ -0,0 +1,30 @@
+package com.baeldung.hibernate_parameters;
+
+public class Event {
+ private Long id;
+
+ private String title;
+
+ public Event() {
+ }
+
+ public Event(String title) {
+ this.title = title;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ private void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+}
\ No newline at end of file
diff --git a/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/NamedParameterUnitTest.java b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/NamedParameterUnitTest.java
new file mode 100644
index 0000000000..23854dc393
--- /dev/null
+++ b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/NamedParameterUnitTest.java
@@ -0,0 +1,72 @@
+package com.baeldung.hibernate_parameters;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.boot.MetadataSources;
+import org.hibernate.boot.registry.StandardServiceRegistry;
+import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
+import org.hibernate.query.Query;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
+
+public class NamedParameterUnitTest {
+ private SessionFactory sessionFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()
+ .configure()
+ .build();
+ try {
+ sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();
+ Session session = sessionFactory.openSession();
+ session.beginTransaction();
+ session.save(new Event("Event 1"));
+ session.save(new Event("Event 2"));
+ session.getTransaction().commit();
+ session.close();
+ } catch (Exception e) {
+ StandardServiceRegistryBuilder.destroy(registry);
+ }
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (sessionFactory != null) {
+ sessionFactory.close();
+ }
+ }
+
+ @Test
+ public void whenNamedParameterProvided_thenCorrect() {
+ Session session = sessionFactory.openSession();
+ session.beginTransaction();
+ Query query = session.createQuery("from Event E WHERE E.title = :eventTitle", Event.class);
+
+ // This binds the value "Event1" to the parameter :eventTitle
+ query.setParameter("eventTitle", "Event 1");
+
+ assertEquals(1, query.list().size());
+ session.getTransaction().commit();
+ session.close();
+ }
+
+ @Test(expected = org.hibernate.QueryException.class)
+ public void whenNamedParameterMissing_thenThrowsQueryException() {
+ Session session = sessionFactory.openSession();
+ session.beginTransaction();
+ Query query = session.createQuery("from Event E WHERE E.title = :eventTitle", Event.class);
+
+ try {
+ query.list();
+ fail("We are expecting an exception!");
+ } finally {
+ session.getTransaction().commit();
+ session.close();
+ }
+ }
+}
diff --git a/persistence-modules/hibernate-parameters/src/test/resources/hibernate.cfg.xml b/persistence-modules/hibernate-parameters/src/test/resources/hibernate.cfg.xml
new file mode 100644
index 0000000000..480baae4c1
--- /dev/null
+++ b/persistence-modules/hibernate-parameters/src/test/resources/hibernate.cfg.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+ org.h2.Driver
+ jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE
+ sa
+
+
+ 1
+
+ org.hibernate.dialect.H2Dialect
+
+ org.hibernate.cache.internal.NoCacheProvider
+
+ true
+
+ create
+
+
+
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/java-jpa-2/README.md b/persistence-modules/java-jpa-2/README.md
index 579dcbdab0..0e1889c1fc 100644
--- a/persistence-modules/java-jpa-2/README.md
+++ b/persistence-modules/java-jpa-2/README.md
@@ -1,4 +1,8 @@
# Relevant Articles
-- [JPA Query Parameters Usage](http://www.baeldung.com/jpa-query-parameters-usage)
+- [JPA Query Parameters Usage](https://www.baeldung.com/jpa-query-parameters-usage)
- [Mapping Entitiy Class Names to SQL Table Names with JPA](https://www.baeldung.com/jpa-entity-table-names)
+- [Default Column Values in JPA](https://www.baeldung.com/jpa-default-column-values)
+- [Types of JPA Queries](https://www.baeldung.com/jpa-queries)
+- [JPA/Hibernate Projections](https://www.baeldung.com/jpa-hibernate-projections)
+- [Combining JPA And/Or Criteria Predicates](https://www.baeldung.com/jpa-and-or-criteria-predicates)
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/CustomItemRepository.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepository.java
similarity index 59%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/CustomItemRepository.java
rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepository.java
index c55dc4a592..c85ac53ac2 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/CustomItemRepository.java
+++ b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepository.java
@@ -1,12 +1,10 @@
-package com.baeldung.jpa.criteria.repository;
-
-import java.util.List;
-
-import com.baeldung.jpa.criteria.entity.Item;
-
-public interface CustomItemRepository {
-
- List findItemsByColorAndGrade();
-
- List findItemByColorOrGrade();
-}
+package com.baeldung.jpa.criteria;
+
+import java.util.List;
+
+public interface CustomItemRepository {
+
+ List findItemsByColorAndGrade();
+
+ List findItemByColorOrGrade();
+}
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryImpl.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepositoryImpl.java
similarity index 91%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryImpl.java
rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepositoryImpl.java
index bf1d3eed0b..c64cd14ca5 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryImpl.java
+++ b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepositoryImpl.java
@@ -1,77 +1,72 @@
-package com.baeldung.jpa.criteria.repository.impl;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import com.baeldung.jpa.criteria.entity.Item;
-import com.baeldung.jpa.criteria.repository.CustomItemRepository;
-
-public class CustomItemRepositoryImpl implements CustomItemRepository {
-
- private EntityManager entityManager;
-
- public CustomItemRepositoryImpl() {
- super();
- EntityManagerFactory factory = Persistence.createEntityManagerFactory("jpa-h2-criteria");
- entityManager = factory.createEntityManager();
- }
-
- @Override
- public List findItemsByColorAndGrade() {
-
- CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
- CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Item.class);
- Root itemRoot = criteriaQuery.from(Item.class);
-
- Predicate predicateForBlueColor = criteriaBuilder.equal(itemRoot.get("color"), "blue");
- Predicate predicateForRedColor = criteriaBuilder.equal(itemRoot.get("color"), "red");
- Predicate predicateForColor = criteriaBuilder.or(predicateForBlueColor, predicateForRedColor);
-
- Predicate predicateForGradeA = criteriaBuilder.equal(itemRoot.get("grade"), "A");
- Predicate predicateForGradeB = criteriaBuilder.equal(itemRoot.get("grade"), "B");
- Predicate predicateForGrade = criteriaBuilder.or(predicateForGradeA, predicateForGradeB);
-
- // final search filter
- Predicate finalPredicate = criteriaBuilder.and(predicateForColor, predicateForGrade);
-
- criteriaQuery.where(finalPredicate);
-
- List items = entityManager.createQuery(criteriaQuery)
- .getResultList();
- return items;
- }
-
- @Override
- public List findItemByColorOrGrade() {
-
- CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
- CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Item.class);
- Root itemRoot = criteriaQuery.from(Item.class);
-
- Predicate predicateForBlueColor = criteriaBuilder.equal(itemRoot.get("color"), "red");
- Predicate predicateForGradeA = criteriaBuilder.equal(itemRoot.get("grade"), "D");
- Predicate predicateForBlueColorAndGradeA = criteriaBuilder.and(predicateForBlueColor, predicateForGradeA);
-
- Predicate predicateForRedColor = criteriaBuilder.equal(itemRoot.get("color"), "blue");
- Predicate predicateForGradeB = criteriaBuilder.equal(itemRoot.get("grade"), "B");
- Predicate predicateForRedColorAndGradeB = criteriaBuilder.and(predicateForRedColor, predicateForGradeB);
-
- // final search filter
- Predicate finalPredicate = criteriaBuilder.or(predicateForBlueColorAndGradeA, predicateForRedColorAndGradeB);
-
- criteriaQuery.where(finalPredicate);
-
- List items = entityManager.createQuery(criteriaQuery)
- .getResultList();
- return items;
- }
-}
+package com.baeldung.jpa.criteria;
+
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+
+public class CustomItemRepositoryImpl implements CustomItemRepository {
+
+ private EntityManager entityManager;
+
+ public CustomItemRepositoryImpl() {
+ super();
+ EntityManagerFactory factory = Persistence.createEntityManagerFactory("jpa-h2-criteria");
+ entityManager = factory.createEntityManager();
+ }
+
+ @Override
+ public List findItemsByColorAndGrade() {
+
+ CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+ CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Item.class);
+ Root itemRoot = criteriaQuery.from(Item.class);
+
+ Predicate predicateForBlueColor = criteriaBuilder.equal(itemRoot.get("color"), "blue");
+ Predicate predicateForRedColor = criteriaBuilder.equal(itemRoot.get("color"), "red");
+ Predicate predicateForColor = criteriaBuilder.or(predicateForBlueColor, predicateForRedColor);
+
+ Predicate predicateForGradeA = criteriaBuilder.equal(itemRoot.get("grade"), "A");
+ Predicate predicateForGradeB = criteriaBuilder.equal(itemRoot.get("grade"), "B");
+ Predicate predicateForGrade = criteriaBuilder.or(predicateForGradeA, predicateForGradeB);
+
+ // final search filter
+ Predicate finalPredicate = criteriaBuilder.and(predicateForColor, predicateForGrade);
+
+ criteriaQuery.where(finalPredicate);
+
+ List items = entityManager.createQuery(criteriaQuery)
+ .getResultList();
+ return items;
+ }
+
+ @Override
+ public List findItemByColorOrGrade() {
+
+ CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+ CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Item.class);
+ Root itemRoot = criteriaQuery.from(Item.class);
+
+ Predicate predicateForBlueColor = criteriaBuilder.equal(itemRoot.get("color"), "red");
+ Predicate predicateForGradeA = criteriaBuilder.equal(itemRoot.get("grade"), "D");
+ Predicate predicateForBlueColorAndGradeA = criteriaBuilder.and(predicateForBlueColor, predicateForGradeA);
+
+ Predicate predicateForRedColor = criteriaBuilder.equal(itemRoot.get("color"), "blue");
+ Predicate predicateForGradeB = criteriaBuilder.equal(itemRoot.get("grade"), "B");
+ Predicate predicateForRedColorAndGradeB = criteriaBuilder.and(predicateForRedColor, predicateForGradeB);
+
+ // final search filter
+ Predicate finalPredicate = criteriaBuilder.or(predicateForBlueColorAndGradeA, predicateForRedColorAndGradeB);
+
+ criteriaQuery.where(finalPredicate);
+
+ List items = entityManager.createQuery(criteriaQuery)
+ .getResultList();
+ return items;
+ }
+}
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/entity/Item.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/Item.java
similarity index 89%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/entity/Item.java
rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/Item.java
index 64ef46f265..f6093e5735 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/entity/Item.java
+++ b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/Item.java
@@ -1,49 +1,49 @@
-package com.baeldung.jpa.criteria.entity;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Table(name = "item")
-@Entity
-public class Item {
-
- @Id
- private Long id;
- private String color;
- private String grade;
- private String name;
-
- public String getColor() {
- return color;
- }
-
- public String getGrade() {
- return grade;
- }
-
- public Long getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setColor(String color) {
- this.color = color;
- }
-
- public void setGrade(String grade) {
- this.grade = grade;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
+package com.baeldung.jpa.criteria;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Table(name = "item")
+@Entity
+public class Item {
+
+ @Id
+ private Long id;
+ private String color;
+ private String grade;
+ private String name;
+
+ public String getColor() {
+ return color;
+ }
+
+ public String getGrade() {
+ return grade;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setColor(String color) {
+ this.color = color;
+ }
+
+ public void setGrade(String grade) {
+ this.grade = grade;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/defaultvalues/User.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/defaultvalues/User.java
similarity index 100%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/defaultvalues/User.java
rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/defaultvalues/User.java
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/defaultvalues/UserRepository.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/defaultvalues/UserRepository.java
similarity index 100%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/defaultvalues/UserRepository.java
rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/defaultvalues/UserRepository.java
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/projections/Product.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/projections/Product.java
similarity index 100%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/projections/Product.java
rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/projections/Product.java
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/projections/ProductRepository.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/projections/ProductRepository.java
similarity index 100%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/projections/ProductRepository.java
rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/projections/ProductRepository.java
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/querytypes/QueryTypesExamples.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/querytypes/QueryTypesExamples.java
similarity index 100%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/querytypes/QueryTypesExamples.java
rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/querytypes/QueryTypesExamples.java
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/querytypes/UserEntity.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/querytypes/UserEntity.java
similarity index 100%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/querytypes/UserEntity.java
rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/querytypes/UserEntity.java
diff --git a/persistence-modules/java-jpa-2/src/main/resources/META-INF/persistence.xml b/persistence-modules/java-jpa-2/src/main/resources/META-INF/persistence.xml
index 560a75070c..62d7ce0f5e 100644
--- a/persistence-modules/java-jpa-2/src/main/resources/META-INF/persistence.xml
+++ b/persistence-modules/java-jpa-2/src/main/resources/META-INF/persistence.xml
@@ -32,4 +32,91 @@
value="queryparams.sql" />
+
+
+ org.hibernate.jpa.HibernatePersistenceProvider
+ com.baeldung.jpa.defaultvalues.User
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.hibernate.jpa.HibernatePersistenceProvider
+ com.baeldung.jpa.querytypes.UserEntity
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.hibernate.jpa.HibernatePersistenceProvider
+ com.baeldung.jpa.projections.Product
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.hibernate.jpa.HibernatePersistenceProvider
+ com.baeldung.jpa.criteria.Item
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/java-jpa/src/test/resources/item.sql b/persistence-modules/java-jpa-2/src/main/resources/item.sql
similarity index 98%
rename from persistence-modules/java-jpa/src/test/resources/item.sql
rename to persistence-modules/java-jpa-2/src/main/resources/item.sql
index faf50f6829..871dcee017 100644
--- a/persistence-modules/java-jpa/src/test/resources/item.sql
+++ b/persistence-modules/java-jpa-2/src/main/resources/item.sql
@@ -1,4 +1,4 @@
-insert into item(id,grade,color) values (10,'C','blue');
-insert into item(id,grade,color) values (11,'C','red');
-insert into item(id,grade,color) values (12,'A','blue');
+insert into item(id,grade,color) values (10,'C','blue');
+insert into item(id,grade,color) values (11,'C','red');
+insert into item(id,grade,color) values (12,'A','blue');
insert into item(id,grade,color) values (13,'D','red');
\ No newline at end of file
diff --git a/persistence-modules/java-jpa/src/main/resources/products_jpa.sql b/persistence-modules/java-jpa-2/src/main/resources/products_jpa.sql
similarity index 100%
rename from persistence-modules/java-jpa/src/main/resources/products_jpa.sql
rename to persistence-modules/java-jpa-2/src/main/resources/products_jpa.sql
diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryIntegrationTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/criteria/CustomItemRepositoryIntegrationTest.java
similarity index 86%
rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryIntegrationTest.java
rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/criteria/CustomItemRepositoryIntegrationTest.java
index 169fb44618..8d6bf3c4a7 100644
--- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryIntegrationTest.java
+++ b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/criteria/CustomItemRepositoryIntegrationTest.java
@@ -1,44 +1,44 @@
-package com.baeldung.jpa.criteria.repository.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-
-import java.util.List;
-
-import org.junit.Test;
-
-import com.baeldung.jpa.criteria.entity.Item;
-import com.baeldung.jpa.criteria.repository.CustomItemRepository;
-
-public class CustomItemRepositoryIntegrationTest {
-
- CustomItemRepository customItemRepository = new CustomItemRepositoryImpl();
-
- @Test
- public void givenItems_whenFindItemsByColorAndGrade_thenReturnItems() {
-
- List items = customItemRepository.findItemsByColorAndGrade();
-
- assertFalse("No items found", items.isEmpty());
- assertEquals("There should be only one item", 1, items.size());
-
- Item item = items.get(0);
-
- assertEquals("this item do not have blue color", "blue", item.getColor());
- assertEquals("this item does not belong to A grade", "A", item.getGrade());
- }
-
- @Test
- public void givenItems_whenFindItemByColorOrGrade_thenReturnItems() {
-
- List items = customItemRepository.findItemByColorOrGrade();
-
- assertFalse("No items found", items.isEmpty());
- assertEquals("There should be only one item", 1, items.size());
-
- Item item = items.get(0);
-
- assertEquals("this item do not have red color", "red", item.getColor());
- assertEquals("this item does not belong to D grade", "D", item.getGrade());
- }
-}
+package com.baeldung.jpa.criteria;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import java.util.List;
+
+import org.junit.Test;
+
+import com.baeldung.jpa.criteria.Item;
+import com.baeldung.jpa.criteria.CustomItemRepository;
+
+public class CustomItemRepositoryIntegrationTest {
+
+ CustomItemRepository customItemRepository = new CustomItemRepositoryImpl();
+
+ @Test
+ public void givenItems_whenFindItemsByColorAndGrade_thenReturnItems() {
+
+ List items = customItemRepository.findItemsByColorAndGrade();
+
+ assertFalse("No items found", items.isEmpty());
+ assertEquals("There should be only one item", 1, items.size());
+
+ Item item = items.get(0);
+
+ assertEquals("this item do not have blue color", "blue", item.getColor());
+ assertEquals("this item does not belong to A grade", "A", item.getGrade());
+ }
+
+ @Test
+ public void givenItems_whenFindItemByColorOrGrade_thenReturnItems() {
+
+ List items = customItemRepository.findItemByColorOrGrade();
+
+ assertFalse("No items found", items.isEmpty());
+ assertEquals("There should be only one item", 1, items.size());
+
+ Item item = items.get(0);
+
+ assertEquals("this item do not have red color", "red", item.getColor());
+ assertEquals("this item does not belong to D grade", "D", item.getGrade());
+ }
+}
diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/defaultvalues/UserDefaultValuesUnitTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/defaultvalues/UserDefaultValuesUnitTest.java
similarity index 100%
rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/defaultvalues/UserDefaultValuesUnitTest.java
rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/defaultvalues/UserDefaultValuesUnitTest.java
diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/projections/HibernateProjectionsIntegrationTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/projections/HibernateProjectionsIntegrationTest.java
similarity index 100%
rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/projections/HibernateProjectionsIntegrationTest.java
rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/projections/HibernateProjectionsIntegrationTest.java
diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/projections/ProductRepositoryIntegrationTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/projections/ProductRepositoryIntegrationTest.java
similarity index 100%
rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/projections/ProductRepositoryIntegrationTest.java
rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/projections/ProductRepositoryIntegrationTest.java
diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/querytypes/QueryTypesExamplesIntegrationTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/querytypes/QueryTypesExamplesIntegrationTest.java
similarity index 100%
rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/querytypes/QueryTypesExamplesIntegrationTest.java
rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/querytypes/QueryTypesExamplesIntegrationTest.java
diff --git a/persistence-modules/java-jpa/src/test/resources/products.sql b/persistence-modules/java-jpa-2/src/test/resources/products.sql
similarity index 100%
rename from persistence-modules/java-jpa/src/test/resources/products.sql
rename to persistence-modules/java-jpa-2/src/test/resources/products.sql
diff --git a/persistence-modules/java-jpa/src/test/resources/users.sql b/persistence-modules/java-jpa-2/src/test/resources/users.sql
similarity index 100%
rename from persistence-modules/java-jpa/src/test/resources/users.sql
rename to persistence-modules/java-jpa-2/src/test/resources/users.sql
diff --git a/persistence-modules/java-jpa/README.md b/persistence-modules/java-jpa/README.md
index 5a99217f45..670203f10d 100644
--- a/persistence-modules/java-jpa/README.md
+++ b/persistence-modules/java-jpa/README.md
@@ -1,16 +1,12 @@
# Relevant Articles
-- [A Guide to SqlResultSetMapping](http://www.baeldung.com/jpa-sql-resultset-mapping)
-- [A Guide to Stored Procedures with JPA](http://www.baeldung.com/jpa-stored-procedures)
+- [A Guide to SqlResultSetMapping](https://www.baeldung.com/jpa-sql-resultset-mapping)
+- [A Guide to Stored Procedures with JPA](https://www.baeldung.com/jpa-stored-procedures)
- [Fixing the JPA error “java.lang.String cannot be cast to Ljava.lang.String;”](https://www.baeldung.com/jpa-error-java-lang-string-cannot-be-cast)
- [JPA Entity Graph](https://www.baeldung.com/jpa-entity-graph)
- [JPA 2.2 Support for Java 8 Date/Time Types](https://www.baeldung.com/jpa-java-time)
- [Converting Between LocalDate and SQL Date](https://www.baeldung.com/java-convert-localdate-sql-date)
-- [Combining JPA And/Or Criteria Predicates](https://www.baeldung.com/jpa-and-or-criteria-predicates)
-- [Types of JPA Queries](https://www.baeldung.com/jpa-queries)
-- [JPA/Hibernate Projections](https://www.baeldung.com/jpa-hibernate-projections)
- [Composite Primary Keys in JPA](https://www.baeldung.com/jpa-composite-primary-keys)
- [Defining JPA Entities](https://www.baeldung.com/jpa-entities)
- [JPA @Basic Annotation](https://www.baeldung.com/jpa-basic-annotation)
-- [Default Column Values in JPA](https://www.baeldung.com/jpa-default-column-values)
- [Persisting Enums in JPA](https://www.baeldung.com/jpa-persisting-enums-in-jpa)
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/util/LocalDateConverter.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/convertdates/LocalDateConverter.java
similarity index 94%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/util/LocalDateConverter.java
rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/convertdates/LocalDateConverter.java
index 00fd378b05..de6ada2361 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/util/LocalDateConverter.java
+++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/convertdates/LocalDateConverter.java
@@ -1,4 +1,4 @@
-package com.baeldung.util;
+package com.baeldung.jpa.convertdates;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/util/Gender.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Gender.java
similarity index 54%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/util/Gender.java
rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Gender.java
index 13f08d995c..8f808f539d 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/util/Gender.java
+++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Gender.java
@@ -1,4 +1,4 @@
-package com.baeldung.util;
+package com.baeldung.jpa.entity;
public enum Gender {
MALE,
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Student.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Student.java
index 531bae40c5..64e7ab586c 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Student.java
+++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Student.java
@@ -14,8 +14,6 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
-import com.baeldung.util.Gender;
-
@Entity
@Table(name="STUDENT")
public class Student {
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Account.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Account.java
similarity index 95%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Account.java
rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Account.java
index 48a98512fa..915c605e65 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Account.java
+++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Account.java
@@ -1,4 +1,4 @@
-package com.baeldung.jpa.entity;
+package com.baeldung.jpa.primarykeys;
import javax.persistence.Entity;
import javax.persistence.Id;
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/AccountId.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/AccountId.java
similarity index 97%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/AccountId.java
rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/AccountId.java
index 091c326367..1e8a06be63 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/AccountId.java
+++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/AccountId.java
@@ -1,4 +1,4 @@
-package com.baeldung.jpa.entity;
+package com.baeldung.jpa.primarykeys;
import java.io.Serializable;
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Book.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Book.java
similarity index 93%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Book.java
rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Book.java
index 460f302e28..a84eb3ef01 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Book.java
+++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Book.java
@@ -1,4 +1,4 @@
-package com.baeldung.jpa.entity;
+package com.baeldung.jpa.primarykeys;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/BookId.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/BookId.java
similarity index 97%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/BookId.java
rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/BookId.java
index ff587beaf2..d8c925c148 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/BookId.java
+++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/BookId.java
@@ -1,4 +1,4 @@
-package com.baeldung.jpa.entity;
+package com.baeldung.jpa.primarykeys;
import java.io.Serializable;
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/Employee.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/Employee.java
similarity index 85%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/Employee.java
rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/Employee.java
index bec1b8845a..b62a21d481 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/Employee.java
+++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/Employee.java
@@ -1,4 +1,4 @@
-package com.baeldung.sqlresultsetmapping;
+package com.baeldung.jpa.sqlresultsetmapping;
import javax.persistence.*;
@@ -7,7 +7,7 @@ import javax.persistence.*;
name="EmployeeResult",
entities={
@EntityResult(
- entityClass = com.baeldung.sqlresultsetmapping.Employee.class,
+ entityClass = com.baeldung.jpa.sqlresultsetmapping.Employee.class,
fields={@FieldResult(name="id",column="employeeNumber"),
@FieldResult(name="name", column="name")}
)
diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/ScheduledDay.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/ScheduledDay.java
similarity index 89%
rename from persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/ScheduledDay.java
rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/ScheduledDay.java
index 7e332bc67a..a7ca59ab3f 100644
--- a/persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/ScheduledDay.java
+++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/ScheduledDay.java
@@ -1,18 +1,18 @@
-package com.baeldung.sqlresultsetmapping;
+package com.baeldung.jpa.sqlresultsetmapping;
import javax.persistence.*;
@SqlResultSetMappings(value = {
@SqlResultSetMapping(name = "ScheduleResult",
- classes = { @ConstructorResult(targetClass = com.baeldung.sqlresultsetmapping.ScheduledDay.class,
+ classes = { @ConstructorResult(targetClass = com.baeldung.jpa.sqlresultsetmapping.ScheduledDay.class,
columns = { @ColumnResult(name = "id", type = Long.class),
@ColumnResult(name = "employeeId", type = Long.class),
@ColumnResult(name = "dayOfWeek") }) }),
@SqlResultSetMapping(name = "FridayEmployeeResult",
columns = { @ColumnResult(name = "employeeId") }),
@SqlResultSetMapping(name = "EmployeeScheduleResults",
- entities = { @EntityResult(entityClass = com.baeldung.sqlresultsetmapping.Employee.class),
- @EntityResult(entityClass = com.baeldung.sqlresultsetmapping.ScheduledDay.class)
+ entities = { @EntityResult(entityClass = com.baeldung.jpa.sqlresultsetmapping.Employee.class),
+ @EntityResult(entityClass = com.baeldung.jpa.sqlresultsetmapping.ScheduledDay.class)
}) })
@NamedNativeQuery(name = "FridayEmployees",
query = "SELECT employeeId FROM schedule_days WHERE dayOfWeek = 'FRIDAY'",
diff --git a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml
index 1f16bee3ba..b780a6f569 100644
--- a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml
+++ b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml
@@ -7,8 +7,8 @@
org.hibernate.jpa.HibernatePersistenceProvider
- com.baeldung.sqlresultsetmapping.ScheduledDay
- com.baeldung.sqlresultsetmapping.Employee
+ com.baeldung.jpa.sqlresultsetmapping.ScheduledDay
+ com.baeldung.jpa.sqlresultsetmapping.Employeecom.baeldung.jpa.basicannotation.Coursetrue
@@ -115,77 +115,13 @@
-
- org.hibernate.jpa.HibernatePersistenceProvider
- com.baeldung.jpa.criteria.entity.Item
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.hibernate.jpa.HibernatePersistenceProvider
- com.baeldung.jpa.querytypes.UserEntity
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.hibernate.jpa.HibernatePersistenceProvider
- com.baeldung.jpa.defaultvalues.User
- true
-
-
-
-
-
-
-
-
-
-
-
-
org.hibernate.jpa.HibernatePersistenceProvidercom.baeldung.jpa.entity.Student
- com.baeldung.jpa.entity.Book
- com.baeldung.jpa.entity.BookId
- com.baeldung.jpa.entity.Account
- com.baeldung.jpa.entity.AccountId
+ com.baeldung.jpa.primarykeys.Book
+ com.baeldung.jpa.primarykeys.BookId
+ com.baeldung.jpa.primarykeys.Account
+ com.baeldung.jpa.primarykeys.AccountIdtrue
-
- org.hibernate.jpa.HibernatePersistenceProvider
- com.baeldung.jpa.projections.Product
- true
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/StudentEntityIntegrationTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/StudentEntityIntegrationTest.java
index fdaaba5439..3c7a82edc3 100644
--- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/StudentEntityIntegrationTest.java
+++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/StudentEntityIntegrationTest.java
@@ -16,8 +16,6 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import com.baeldung.util.Gender;
-
public class StudentEntityIntegrationTest {
private EntityManagerFactory emf;
diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/CompositeKeysIntegrationTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/primarykeys/CompositeKeysIntegrationTest.java
similarity index 93%
rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/CompositeKeysIntegrationTest.java
rename to persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/primarykeys/CompositeKeysIntegrationTest.java
index 2d30ebab5e..be529ab81c 100644
--- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/CompositeKeysIntegrationTest.java
+++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/primarykeys/CompositeKeysIntegrationTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.jpa.entity;
+package com.baeldung.jpa.primarykeys;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -7,6 +7,10 @@ import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
+import com.baeldung.jpa.primarykeys.Account;
+import com.baeldung.jpa.primarykeys.AccountId;
+import com.baeldung.jpa.primarykeys.Book;
+import com.baeldung.jpa.primarykeys.BookId;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/sqlresultsetmapping/SqlResultSetMappingUnitTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/sqlresultsetmapping/SqlResultSetMappingUnitTest.java
similarity index 98%
rename from persistence-modules/java-jpa/src/test/java/com/baeldung/sqlresultsetmapping/SqlResultSetMappingUnitTest.java
rename to persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/sqlresultsetmapping/SqlResultSetMappingUnitTest.java
index 4e01095278..f318df3747 100644
--- a/persistence-modules/java-jpa/src/test/java/com/baeldung/sqlresultsetmapping/SqlResultSetMappingUnitTest.java
+++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/sqlresultsetmapping/SqlResultSetMappingUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.sqlresultsetmapping;
+package com.baeldung.jpa.sqlresultsetmapping;
import static org.junit.Assert.*;
diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml
index 0c22267192..932b62a235 100644
--- a/persistence-modules/pom.xml
+++ b/persistence-modules/pom.xml
@@ -23,6 +23,7 @@
hibernate5hibernate-ogmhibernate-mapping
+ hibernate-parametersinfluxdbjava-cassandrajava-cockroachdb
diff --git a/persistence-modules/spring-data-eclipselink/README.md b/persistence-modules/spring-data-eclipselink/README.md
index 7981470488..a2518fdb99 100644
--- a/persistence-modules/spring-data-eclipselink/README.md
+++ b/persistence-modules/spring-data-eclipselink/README.md
@@ -1,3 +1,4 @@
### Relevant articles
- [A Guide to EclipseLink with Spring](http://www.baeldung.com/spring-eclipselink)
+- [Pessimistic Locking in JPA](https://www.baeldung.com/jpa-pessimistic-locking)
diff --git a/play-framework/README.md b/play-framework/README.md
index 0fd13fba27..2309b67422 100644
--- a/play-framework/README.md
+++ b/play-framework/README.md
@@ -1,4 +1,4 @@
###Relevant Articles:
-- [REST API with Play Framework in Java](http://www.baeldung.com/rest-api-with-play)
-- [Routing In Play Applications in Java](http://www.baeldung.com/routing-in-play)
-- [Introduction To Play In Java](http://www.baeldung.com/java-intro-to-the-play-framework)
+- [REST API with Play Framework in Java](https://www.baeldung.com/rest-api-with-play)
+- [Routing In Play Applications in Java](https://www.baeldung.com/routing-in-play)
+- [Introduction To Play In Java](https://www.baeldung.com/java-intro-to-the-play-framework)
diff --git a/pom.xml b/pom.xml
index 927e1a25b4..cb3c7c06c4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -389,24 +389,34 @@
core-java-modules/core-java-8core-java-modules/core-java-8-2
+ core-java-modules/core-java-annotations
+ core-java-modules/core-java-streams
+ core-java-modules/core-java-function
+ core-java-modules/core-java-lang-math
+ core-java-modules/core-java-datetime
+ core-java-modules/core-java-textcore-java-modules/core-java-lambdascore-java-modules/core-java-arrayscore-java-modules/core-java-arrays-2core-java-modules/core-java-collections
+ core-java-modules/core-java-collections-2
+ core-java-modules/core-java-collections-3core-java-modules/core-java-collections-listcore-java-modules/core-java-collections-list-2core-java-modules/core-java-collections-list-3core-java-modules/core-java-collections-array-listcore-java-modules/core-java-collections-setcore-java-modules/core-java-concurrency-basic
+ core-java-modules/core-java-concurrency-basic-2core-java-modules/core-java-concurrency-collectionscore-java-modules/core-java-iocore-java-modules/core-java-io-filescore-java-modules/core-java-niocore-java-modules/core-java-securitycore-java-modules/core-java-lang-syntax
+ core-java-modules/core-java-lang-syntax-2core-java-modules/core-java-langcore-java-modules/core-java-lang-2core-java-modules/core-java-lang-oop
@@ -520,6 +530,8 @@
libraries-datalibraries-data-2libraries-apache-commons
+ libraries-apache-commons-collections
+ libraries-apache-commons-iolibraries-primitivelibraries-testinglibraries-security
@@ -532,7 +544,11 @@
lucenemapstruct
- maven
+
+ maven-all/maven
+ maven-all/maven-war-plugin
+ maven-all/profiles
+ maven-all/versions-maven-pluginmaven-archetypemaven-polyglot/maven-polyglot-json-extension
@@ -659,7 +675,6 @@
spring-bootspring-boot-adminspring-boot-angular
- spring-boot-angular-ecommercespring-boot-autoconfigurationspring-boot-bootstrapspring-boot-camel
@@ -1122,23 +1137,33 @@
core-java-modules/core-java-8core-java-modules/core-java-8-2
+ core-java-modules/core-java-annotations
+ core-java-modules/core-java-streams
+ core-java-modules/core-java-function
+ core-java-modules/core-java-lang-math
+ core-java-modules/core-java-datetime
+ core-java-modules/core-java-textcore-java-modules/core-java-arrayscore-java-modules/core-java-arrays-2core-java-modules/core-java-collections
+ core-java-modules/core-java-collections-2
+ core-java-modules/core-java-collections-3core-java-modules/core-java-collections-listcore-java-modules/core-java-collections-list-2core-java-modules/core-java-collections-list-3core-java-modules/core-java-collections-array-listcore-java-modules/core-java-collections-setcore-java-modules/core-java-concurrency-basic
+ core-java-modules/core-java-concurrency-basic-2core-java-modules/core-java-concurrency-collectionscore-java-modules/core-java-iocore-java-modules/core-java-io-filescore-java-modules/core-java-niocore-java-modules/core-java-securitycore-java-modules/core-java-lang-syntax
+ core-java-modules/core-java-lang-syntax-2core-java-modules/core-java-langcore-java-modules/core-java-lang-2core-java-modules/core-java-lang-oop
@@ -1246,6 +1271,8 @@
libraries-datalibraries-data-2libraries-apache-commons
+ libraries-apache-commons-collections
+ libraries-apache-commons-iolibraries-testinglibraries-securitylibraries-server
@@ -1256,7 +1283,11 @@
lucenemapstruct
- maven
+
+ maven-all/maven
+ maven-all/maven-war-plugin
+ maven-all/profiles
+ maven-all/versions-maven-pluginmaven-archetype
@@ -1365,7 +1396,6 @@
spring-bootspring-boot-adminspring-boot-angular
- spring-boot-angular-ecommercespring-boot-autoconfigurationspring-boot-bootstrapspring-boot-camel
diff --git a/protobuffer/README.md b/protobuffer/README.md
index 4dcdb3cf52..4302418a8b 100644
--- a/protobuffer/README.md
+++ b/protobuffer/README.md
@@ -1,3 +1,3 @@
### Relevant articles
-- [Introduction to Google Protocol Buffer](http://www.baeldung.com/google-protocol-buffer)
+- [Introduction to Google Protocol Buffer](https://www.baeldung.com/google-protocol-buffer)
diff --git a/rabbitmq/README.md b/rabbitmq/README.md
index 11300b047f..01e51bd784 100644
--- a/rabbitmq/README.md
+++ b/rabbitmq/README.md
@@ -1,3 +1,3 @@
### Relevant articles
-- [Introduction to RabbitMQ](http://www.baeldung.com/rabbitmq)
+- [Introduction to RabbitMQ](https://www.baeldung.com/rabbitmq)
diff --git a/raml/README.MD b/raml/README.MD
index 2a87b46021..fcf0b41a18 100644
--- a/raml/README.MD
+++ b/raml/README.MD
@@ -1,2 +1,2 @@
###The Course
-The "REST With Spring" Classes: http://bit.ly/restwithspring
+The "REST With Spring" Classes: https://bit.ly/restwithspring
diff --git a/ratpack/README.md b/ratpack/README.md
index 78e2f8ccfc..706fd0c8c3 100644
--- a/ratpack/README.md
+++ b/ratpack/README.md
@@ -1,9 +1,9 @@
### Relevant articles
-- [Introduction to Ratpack](http://www.baeldung.com/ratpack)
-- [Ratpack Google Guice Integration](http://www.baeldung.com/ratpack-google-guice)
+- [Introduction to Ratpack](https://www.baeldung.com/ratpack)
+- [Ratpack Google Guice Integration](https://www.baeldung.com/ratpack-google-guice)
- [Ratpack Integration with Spring Boot](http://www.baeldung.com/ratpack-spring-boot)
-- [Ratpack with Hystrix](http://www.baeldung.com/ratpack-hystrix)
+- [Ratpack with Hystrix](https://www.baeldung.com/ratpack-hystrix)
- [Ratpack HTTP Client](https://www.baeldung.com/ratpack-http-client)
- [Ratpack with RxJava](https://www.baeldung.com/ratpack-rxjava)
- [Ratpack with Groovy](https://www.baeldung.com/ratpack-groovy)
diff --git a/reactor-core/README.md b/reactor-core/README.md
index 5f9d2d1bc2..ba5b355d02 100644
--- a/reactor-core/README.md
+++ b/reactor-core/README.md
@@ -1,5 +1,5 @@
### Relevant articles
-- [Intro To Reactor Core](http://www.baeldung.com/reactor-core)
-- [Combining Publishers in Project Reactor](http://www.baeldung.com/reactor-combine-streams)
+- [Intro To Reactor Core](https://www.baeldung.com/reactor-core)
+- [Combining Publishers in Project Reactor](https://www.baeldung.com/reactor-combine-streams)
- [Programmatically Creating Sequences with Project Reactor](https://www.baeldung.com/flux-sequences-reactor)
diff --git a/resteasy/README.md b/resteasy/README.md
index 83051037d2..3f3c833256 100644
--- a/resteasy/README.md
+++ b/resteasy/README.md
@@ -4,6 +4,6 @@
### Relevant Articles:
-- [A Guide to RESTEasy](http://www.baeldung.com/resteasy-tutorial)
-- [RESTEasy Client API](http://www.baeldung.com/resteasy-client-tutorial)
-- [CORS in JAX-RS](http://www.baeldung.com/cors-in-jax-rs)
+- [A Guide to RESTEasy](https://www.baeldung.com/resteasy-tutorial)
+- [RESTEasy Client API](https://www.baeldung.com/resteasy-client-tutorial)
+- [CORS in JAX-RS](https://www.baeldung.com/cors-in-jax-rs)
diff --git a/rule-engines/README.md b/rule-engines/README.md
index 6d3c0e93b4..37d419daf5 100644
--- a/rule-engines/README.md
+++ b/rule-engines/README.md
@@ -1,3 +1,3 @@
## Relevant articles:
-- [List of Rules Engines in Java](http://www.baeldung.com/java-rule-engines)
+- [List of Rules Engines in Java](https://www.baeldung.com/java-rule-engines)
diff --git a/rxjava-2/README.md b/rxjava-2/README.md
index 4182f3fa00..43c1a9942b 100644
--- a/rxjava-2/README.md
+++ b/rxjava-2/README.md
@@ -1,9 +1,9 @@
## Relevant articles:
-- [RxJava and Error Handling](http://www.baeldung.com/rxjava-error-handling)
-- [RxJava 2 – Flowable](http://www.baeldung.com/rxjava-2-flowable)
-- [RxJava Maybe](http://www.baeldung.com/rxjava-maybe)
-- [Introduction to RxRelay for RxJava](http://www.baeldung.com/rx-relay)
+- [RxJava and Error Handling](https://www.baeldung.com/rxjava-error-handling)
+- [RxJava 2 – Flowable](https://www.baeldung.com/rxjava-2-flowable)
+- [RxJava Maybe](https://www.baeldung.com/rxjava-maybe)
+- [Introduction to RxRelay for RxJava](https://www.baeldung.com/rx-relay)
- [Combining RxJava Completables](https://www.baeldung.com/rxjava-completable)
- [Converting Synchronous and Asynchronous APIs to Observables using RxJava2](https://www.baeldung.com/rxjava-apis-to-observables)
- [RxJava Hooks](https://www.baeldung.com/rxjava-hooks)
diff --git a/rxjava/README.md b/rxjava/README.md
index f8a4ca1dbe..f9b7e2ba0d 100644
--- a/rxjava/README.md
+++ b/rxjava/README.md
@@ -1,15 +1,15 @@
## Relevant articles:
-- [Dealing with Backpressure with RxJava](http://www.baeldung.com/rxjava-backpressure)
-- [How to Test RxJava?](http://www.baeldung.com/rxjava-testing)
-- [Implementing Custom Operators in RxJava](http://www.baeldung.com/rxjava-custom-operators)
-- [Introduction to RxJava](http://www.baeldung.com/rx-java)
-- [Observable Utility Operators in RxJava](http://www.baeldung.com/rxjava-observable-operators)
-- [Introduction to rxjava-jdbc](http://www.baeldung.com/rxjava-jdbc)
-- [Schedulers in RxJava](http://www.baeldung.com/rxjava-schedulers)
-- [Mathematical and Aggregate Operators in RxJava](http://www.baeldung.com/rxjava-math)
-- [Combining Observables in RxJava](http://www.baeldung.com/rxjava-combine-observables)
-- [RxJava StringObservable](http://www.baeldung.com/rxjava-string)
-- [Filtering Observables in RxJava](http://www.baeldung.com/rxjava-filtering)
-- [RxJava One Observable, Multiple Subscribers](http://www.baeldung.com/rxjava-multiple-subscribers-observable)
+- [Dealing with Backpressure with RxJava](https://www.baeldung.com/rxjava-backpressure)
+- [How to Test RxJava?](https://www.baeldung.com/rxjava-testing)
+- [Implementing Custom Operators in RxJava](https://www.baeldung.com/rxjava-custom-operators)
+- [Introduction to RxJava](https://www.baeldung.com/rx-java)
+- [Observable Utility Operators in RxJava](https://www.baeldung.com/rxjava-observable-operators)
+- [Introduction to rxjava-jdbc](https://www.baeldung.com/rxjava-jdbc)
+- [Schedulers in RxJava](https://www.baeldung.com/rxjava-schedulers)
+- [Mathematical and Aggregate Operators in RxJava](https://www.baeldung.com/rxjava-math)
+- [Combining Observables in RxJava](https://www.baeldung.com/rxjava-combine-observables)
+- [RxJava StringObservable](https://www.baeldung.com/rxjava-string)
+- [Filtering Observables in RxJava](https://www.baeldung.com/rxjava-filtering)
+- [RxJava One Observable, Multiple Subscribers](https://www.baeldung.com/rxjava-multiple-subscribers-observable)
- [Difference Between Flatmap and Switchmap in RxJava](https://www.baeldung.com/rxjava-flatmap-switchmap)
diff --git a/saas/README.md b/saas/README.md
index 4e0eeea974..4effb2afa9 100644
--- a/saas/README.md
+++ b/saas/README.md
@@ -1,3 +1,7 @@
+## SAAS
+
+This module contains articles about software as a service (SAAS)
+
## Relevant articles:
-- [JIRA REST API Integration](http://www.baeldung.com/jira-rest-api)
+- [JIRA REST API Integration](https://www.baeldung.com/jira-rest-api)
diff --git a/spark-java/README.md b/spark-java/README.md
index 5abe78263c..b3ef62e631 100644
--- a/spark-java/README.md
+++ b/spark-java/README.md
@@ -1,6 +1,6 @@
-=========
+## Spark Java
-## Spark Java Framework Tutorial Sample Project
+This module contains articles about Spark
### Relevant Articles
-- [Building an API With the Spark Java Framework](http://www.baeldung.com/spark-framework-rest-api)
+- [Building an API With the Spark Java Framework](https://www.baeldung.com/spark-framework-rest-api)
diff --git a/spring-4/README.md b/spring-4/README.md
index 57cb8c3eeb..d44eed915e 100644
--- a/spring-4/README.md
+++ b/spring-4/README.md
@@ -1,4 +1,8 @@
+## Spring 4
+
+This module contains articles about Spring 4
+
### Relevant Articles:
-- [A Guide to Flips for Spring](http://www.baeldung.com/flips-spring)
+- [A Guide to Flips for Spring](https://www.baeldung.com/flips-spring)
- [Configuring a Hikari Connection Pool with Spring Boot](https://www.baeldung.com/spring-boot-hikari)
-- [Spring JSON-P with Jackson](http://www.baeldung.com/spring-jackson-jsonp)
+- [Spring JSON-P with Jackson](https://www.baeldung.com/spring-jackson-jsonp)
diff --git a/spring-5-data-reactive/README.md b/spring-5-data-reactive/README.md
index 982704e11c..683b493317 100644
--- a/spring-5-data-reactive/README.md
+++ b/spring-5-data-reactive/README.md
@@ -6,7 +6,7 @@ This module contains articles about reactive Spring 5 Data
The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles
-- [Reactive Flow with MongoDB, Kotlin, and Spring WebFlux](http://www.baeldung.com/kotlin-mongodb-spring-webflux)
-- [Spring Data Reactive Repositories with MongoDB](http://www.baeldung.com/spring-data-mongodb-reactive)
+- [Reactive Flow with MongoDB, Kotlin, and Spring WebFlux](https://www.baeldung.com/kotlin-mongodb-spring-webflux)
+- [Spring Data Reactive Repositories with MongoDB](https://www.baeldung.com/spring-data-mongodb-reactive)
- [Spring Data MongoDB Tailable Cursors](https://www.baeldung.com/spring-data-mongodb-tailable-cursors)
- [A Quick Look at R2DBC with Spring Data](https://www.baeldung.com/spring-data-r2dbc)
diff --git a/spring-5-mvc/README.md b/spring-5-mvc/README.md
index 2b57df3b71..e98012c047 100644
--- a/spring-5-mvc/README.md
+++ b/spring-5-mvc/README.md
@@ -3,5 +3,6 @@
This module contains articles about Spring 5 model-view-controller (MVC) pattern
### Relevant Articles:
-- [Spring Boot and Kotlin](http://www.baeldung.com/spring-boot-kotlin)
+- [Spring Boot and Kotlin](https://www.baeldung.com/spring-boot-kotlin)
- [Spring MVC Streaming and SSE Request Processing](https://www.baeldung.com/spring-mvc-sse-streams)
+- [Interface Driven Controllers in Spring](https://www.baeldung.com/spring-interface-driven-controllers)
diff --git a/spring-5-reactive-2/README.md b/spring-5-reactive-2/README.md
index a8204932f7..8d1d9e1f8e 100644
--- a/spring-5-reactive-2/README.md
+++ b/spring-5-reactive-2/README.md
@@ -3,3 +3,5 @@
This module contains articles about reactive Spring 5
- [Spring WebClient vs. RestTemplate](https://www.baeldung.com/spring-webclient-resttemplate)
+- [Spring WebClient Filters](https://www.baeldung.com/spring-webclient-filters)
+- More articles: [[<-- prev]](/spring-5-reactive)
diff --git a/spring-5-reactive-client/pom.xml b/spring-5-reactive-client/pom.xml
index 70771f6832..994239fa9b 100644
--- a/spring-5-reactive-client/pom.xml
+++ b/spring-5-reactive-client/pom.xml
@@ -54,6 +54,18 @@
org.apache.commonscommons-lang3
+
+
+ com.squareup.okhttp3
+ okhttp
+ 4.0.1
+
+
+ com.squareup.okhttp3
+ mockwebserver
+ 4.0.1
+ test
+
@@ -76,6 +88,12 @@
spring-boot-starter-testtest
+
+ com.github.tomakehurst
+ wiremock
+ 2.24.1
+ test
+ org.apache.commons
@@ -88,14 +106,25 @@
org.projectlomboklombok
-
-
+
+ org.mockito
+ mockito-junit-jupiter
+ 2.23.0
+ test
+
+
+ io.projectreactor
+ reactor-test
+ 3.2.10.RELEASE
+ test
+ org.eclipse.jettyjetty-reactive-httpclient${jetty-reactive-httpclient.version}test
+
@@ -108,6 +137,29 @@
JAR
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.8
+ 1.8
+
+
+
+ maven-surefire-plugin
+ 2.22.0
+
+
+ maven-surefire-plugin
+ 2.19.1
+
+
+ org.junit.platform
+ junit-platform-surefire-provider
+ 1.0.1
+
+
+
diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/enums/Role.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/enums/Role.java
new file mode 100644
index 0000000000..6b11f14734
--- /dev/null
+++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/enums/Role.java
@@ -0,0 +1,5 @@
+package com.baeldung.reactive.enums;
+
+public enum Role {
+ ENGINEER, SENIOR_ENGINEER, LEAD_ENGINEER
+}
diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/model/Employee.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/model/Employee.java
new file mode 100644
index 0000000000..6a8daaf6de
--- /dev/null
+++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/model/Employee.java
@@ -0,0 +1,64 @@
+package com.baeldung.reactive.model;
+
+
+import com.baeldung.reactive.enums.Role;
+
+public class Employee {
+ private Integer employeeId;
+ private String firstName;
+ private String lastName;
+ private Integer age;
+ private Role role;
+
+ public Employee() {
+ }
+
+ public Employee(Integer employeeId, String firstName, String lastName, Integer age, Role role) {
+ this.employeeId = employeeId;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.age = age;
+ this.role = role;
+ }
+
+ public Integer getEmployeeId() {
+ return employeeId;
+ }
+
+ public void setEmployeeId(Integer employeeId) {
+ this.employeeId = employeeId;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+
+ public Role getRole() {
+ return role;
+ }
+
+ public void setRole(Role role) {
+ this.role = role;
+ }
+}
+
diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/service/EmployeeService.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/service/EmployeeService.java
new file mode 100644
index 0000000000..b841dbfe3f
--- /dev/null
+++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/service/EmployeeService.java
@@ -0,0 +1,55 @@
+package com.baeldung.reactive.service;
+import com.baeldung.reactive.model.Employee;
+import org.springframework.web.reactive.function.client.WebClient;
+import reactor.core.publisher.Mono;
+
+public class EmployeeService {
+
+ private WebClient webClient;
+ public static String PATH_PARAM_BY_ID = "/employee/{id}";
+ public static String ADD_EMPLOYEE = "/employee";
+
+ public EmployeeService(WebClient webClient) {
+ this.webClient = webClient;
+ }
+
+ public EmployeeService(String baseUrl) {
+ this.webClient = WebClient.create(baseUrl);
+ }
+
+ public Mono getEmployeeById(Integer employeeId) {
+ return webClient
+ .get()
+ .uri(PATH_PARAM_BY_ID, employeeId)
+ .retrieve()
+ .bodyToMono(Employee.class);
+ }
+
+ public Mono addNewEmployee(Employee newEmployee) {
+
+ return webClient
+ .post()
+ .uri(ADD_EMPLOYEE)
+ .syncBody(newEmployee)
+ .retrieve().
+ bodyToMono(Employee.class);
+ }
+
+ public Mono updateEmployee(Integer employeeId, Employee updateEmployee) {
+
+ return webClient
+ .put()
+ .uri(PATH_PARAM_BY_ID,employeeId)
+ .syncBody(updateEmployee)
+ .retrieve()
+ .bodyToMono(Employee.class);
+ }
+
+ public Mono deleteEmployeeById(Integer employeeId) {
+ return webClient
+ .delete()
+ .uri(PATH_PARAM_BY_ID,employeeId)
+ .retrieve()
+ .bodyToMono(String.class);
+ }
+}
diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java
new file mode 100644
index 0000000000..9afe50af58
--- /dev/null
+++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java
@@ -0,0 +1,68 @@
+package com.baeldung.reactive.webclient.simultaneous;
+
+import org.springframework.web.reactive.function.client.WebClient;
+import reactor.core.publisher.Mono;
+import reactor.core.publisher.Flux;
+import reactor.core.scheduler.Schedulers;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+public class Client {
+
+ private static final Logger LOG = Logger.getLogger(Client.class.getName());
+
+ private WebClient webClient;
+
+ public Client(String uri) {
+ this.webClient = WebClient.create(uri);
+ }
+
+ public Mono getUser(int id) {
+ LOG.info(String.format("Calling getUser(%d)", id));
+
+ return webClient.get()
+ .uri("/user/{id}", id)
+ .retrieve()
+ .bodyToMono(User.class);
+ }
+
+ public Mono getItem(int id) {
+ return webClient.get()
+ .uri("/item/{id}", id)
+ .retrieve()
+ .bodyToMono(Item.class);
+ }
+
+ public Mono getOtherUser(int id) {
+ return webClient.get()
+ .uri("/otheruser/{id}", id)
+ .retrieve()
+ .bodyToMono(User.class);
+ }
+
+ public List fetchUsers(List userIds) {
+ return Flux.fromIterable(userIds)
+ .parallel()
+ .runOn(Schedulers.elastic())
+ .flatMap(this::getUser)
+ .collectSortedList((u1, u2) -> u2.id() - u1.id())
+ .block();
+ }
+
+ public List fetchUserAndOtherUser(int id) {
+ return Flux.merge(getUser(id), getOtherUser(id))
+ .parallel()
+ .runOn(Schedulers.elastic())
+ .collectSortedList((u1, u2) -> u2.id() - u1.id())
+ .block();
+ }
+
+ public UserWithItem fetchUserAndItem(int userId, int itemId) {
+ Mono user = getUser(userId).subscribeOn(Schedulers.elastic());
+ Mono item = getItem(itemId).subscribeOn(Schedulers.elastic());
+
+ return Mono.zip(user, item, UserWithItem::new)
+ .block();
+ }
+}
diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Item.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Item.java
new file mode 100644
index 0000000000..5b8260743b
--- /dev/null
+++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Item.java
@@ -0,0 +1,17 @@
+package com.baeldung.reactive.webclient.simultaneous;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Item {
+ private int id;
+
+ @JsonCreator
+ public Item(@JsonProperty("id") int id) {
+ this.id = id;
+ }
+
+ public int id() {
+ return id;
+ }
+}
diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/User.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/User.java
new file mode 100644
index 0000000000..0e1cc2cd76
--- /dev/null
+++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/User.java
@@ -0,0 +1,17 @@
+package com.baeldung.reactive.webclient.simultaneous;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class User {
+ private int id;
+
+ @JsonCreator
+ public User(@JsonProperty("id") int id) {
+ this.id = id;
+ }
+
+ public int id() {
+ return id;
+ }
+}
diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/UserWithItem.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/UserWithItem.java
new file mode 100644
index 0000000000..96dcfe994e
--- /dev/null
+++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/UserWithItem.java
@@ -0,0 +1,19 @@
+package com.baeldung.reactive.webclient.simultaneous;
+
+public class UserWithItem {
+ private User user;
+ private Item item;
+
+ public UserWithItem(User user, Item item) {
+ this.user = user;
+ this.item = item;
+ }
+
+ public User user() {
+ return user;
+ }
+
+ public Item item() {
+ return item;
+ }
+}
diff --git a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceIntegrationTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceIntegrationTest.java
new file mode 100644
index 0000000000..f5d9529ada
--- /dev/null
+++ b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceIntegrationTest.java
@@ -0,0 +1,121 @@
+package com.baeldung.reactive.service;
+
+import com.baeldung.reactive.model.Employee;
+import com.baeldung.reactive.enums.Role;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import okhttp3.mockwebserver.MockResponse;
+import okhttp3.mockwebserver.MockWebServer;
+import okhttp3.mockwebserver.RecordedRequest;
+import org.junit.Rule;
+import org.junit.jupiter.api.*;
+import reactor.core.publisher.Mono;
+import reactor.test.StepVerifier;
+
+import java.io.IOException;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+class EmployeeServiceIntegrationTest {
+
+ public static MockWebServer mockBackEnd;
+ private EmployeeService employeeService;
+ private ObjectMapper MAPPER = new ObjectMapper();
+
+ @BeforeAll
+ static void setUp() throws IOException {
+ mockBackEnd = new MockWebServer();
+ mockBackEnd.start();
+ }
+
+ @AfterAll
+ static void tearDown() throws IOException {
+ mockBackEnd.shutdown();
+ }
+
+ @BeforeEach
+ void initialize() {
+
+ String baseUrl = String.format("http://localhost:%s", mockBackEnd.getPort());
+ employeeService = new EmployeeService(baseUrl);
+ }
+
+ @Test
+ void getEmployeeById() throws Exception {
+
+ Employee mockEmployee = new Employee(100, "Adam", "Sandler", 32, Role.LEAD_ENGINEER);
+ mockBackEnd.enqueue(new MockResponse().setBody(MAPPER.writeValueAsString(mockEmployee))
+ .addHeader("Content-Type", "application/json"));
+
+ Mono employeeMono = employeeService.getEmployeeById(100);
+
+ StepVerifier.create(employeeMono)
+ .expectNextMatches(employee -> employee.getRole().equals(Role.LEAD_ENGINEER))
+ .verifyComplete();
+
+ RecordedRequest recordedRequest = mockBackEnd.takeRequest();
+ assertEquals("GET", recordedRequest.getMethod());
+ assertEquals("/employee/100", recordedRequest.getPath());
+ }
+
+ @Test
+ void addNewEmployee() throws Exception {
+
+ Employee newEmployee = new Employee(null, "Adam", "Sandler", 32, Role.LEAD_ENGINEER);
+ Employee webClientResponse = new Employee(100, "Adam", "Sandler", 32, Role.LEAD_ENGINEER);
+ mockBackEnd.enqueue(new MockResponse().setBody(MAPPER.writeValueAsString(webClientResponse))
+ .addHeader("Content-Type", "application/json"));
+
+ Mono employeeMono = employeeService.addNewEmployee(newEmployee);
+
+ StepVerifier.create(employeeMono)
+ .expectNextMatches(employee -> employee.getEmployeeId().equals(100))
+ .verifyComplete();
+
+ RecordedRequest recordedRequest = mockBackEnd.takeRequest();
+ assertEquals("POST", recordedRequest.getMethod());
+ assertEquals("/employee", recordedRequest.getPath());
+ }
+
+ @Test
+ void updateEmployee() throws Exception {
+
+ Integer newAge = 33;
+ String newLastName = "Sandler New";
+ Employee updateEmployee = new Employee(100, "Adam", newLastName, newAge, Role.LEAD_ENGINEER);
+ mockBackEnd.enqueue(new MockResponse().setBody(MAPPER.writeValueAsString(updateEmployee))
+ .addHeader("Content-Type", "application/json"));
+
+ Mono updatedEmploye = employeeService.updateEmployee(100, updateEmployee);
+
+ StepVerifier.create(updatedEmploye)
+ .expectNextMatches(employee -> employee.getLastName().equals(newLastName) && employee.getAge() == newAge)
+ .verifyComplete();
+
+ RecordedRequest recordedRequest = mockBackEnd.takeRequest();
+ assertEquals("PUT", recordedRequest.getMethod());
+ assertEquals("/employee/100", recordedRequest.getPath());
+
+ }
+
+
+ @Test
+ void deleteEmployee() throws Exception {
+
+ String responseMessage = "Employee Deleted SuccessFully";
+ Integer employeeId = 100;
+ mockBackEnd.enqueue(new MockResponse().setBody(MAPPER.writeValueAsString(responseMessage))
+ .addHeader("Content-Type", "application/json"));
+
+ Mono deletedEmployee = employeeService.deleteEmployeeById(employeeId);
+
+ StepVerifier.create(deletedEmployee)
+ .expectNext("\"Employee Deleted SuccessFully\"")
+ .verifyComplete();
+
+ RecordedRequest recordedRequest = mockBackEnd.takeRequest();
+ assertEquals("DELETE", recordedRequest.getMethod());
+ assertEquals("/employee/100", recordedRequest.getPath());
+ }
+
+}
\ No newline at end of file
diff --git a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceUnitTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceUnitTest.java
new file mode 100644
index 0000000000..1d1a8fd2e4
--- /dev/null
+++ b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceUnitTest.java
@@ -0,0 +1,114 @@
+package com.baeldung.reactive.service;
+
+
+import com.baeldung.reactive.model.Employee;
+import com.baeldung.reactive.enums.Role;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.exceptions.base.MockitoException;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.springframework.web.reactive.function.client.WebClient;
+import reactor.core.publisher.Mono;
+import reactor.test.StepVerifier;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+@ExtendWith(MockitoExtension.class)
+class EmployeeServiceUnitTest {
+
+ EmployeeService employeeService;
+ @Mock
+ private WebClient webClientMock;
+ @Mock
+ private WebClient.RequestHeadersSpec requestHeadersMock;
+ @Mock
+ private WebClient.RequestHeadersUriSpec requestHeadersUriMock;
+ @Mock
+ private WebClient.RequestBodySpec requestBodyMock;
+ @Mock
+ private WebClient.RequestBodyUriSpec requestBodyUriMock;
+ @Mock
+ private WebClient.ResponseSpec responseMock;
+
+ @BeforeEach
+ void setUp() {
+ employeeService = new EmployeeService(webClientMock);
+ }
+
+ @Test
+ void givenEmployeeId_whenGetEmployeeById_thenReturnEmployee() {
+
+ Integer employeeId = 100;
+ Employee mockEmployee = new Employee(100, "Adam", "Sandler", 32, Role.LEAD_ENGINEER);
+ when(webClientMock.get()).thenReturn(requestHeadersUriMock);
+ when(requestHeadersUriMock.uri("/employee/{id}", employeeId)).thenReturn(requestHeadersMock);
+ when(requestHeadersMock.retrieve()).thenReturn(responseMock);
+ when(responseMock.bodyToMono(Employee.class)).thenReturn(Mono.just(mockEmployee));
+
+ Mono employeeMono = employeeService.getEmployeeById(employeeId);
+
+ StepVerifier.create(employeeMono)
+ .expectNextMatches(employee -> employee.getRole().equals(Role.LEAD_ENGINEER))
+ .verifyComplete();
+ }
+
+ @Test
+ void givenEmployee_whenAddEmployee_thenAddNewEmployee() {
+
+ Employee newEmployee = new Employee(null, "Adam", "Sandler", 32, Role.LEAD_ENGINEER);
+ Employee webClientResponse = new Employee(100, "Adam", "Sandler", 32, Role.LEAD_ENGINEER);
+ when(webClientMock.post()).thenReturn(requestBodyUriMock);
+ when(requestBodyUriMock.uri(EmployeeService.ADD_EMPLOYEE)).thenReturn(requestBodyMock);
+ when(requestBodyMock.syncBody(newEmployee)).thenReturn(requestHeadersMock);
+ when(requestHeadersMock.retrieve()).thenReturn(responseMock);
+ when(responseMock.bodyToMono(Employee.class)).thenReturn(Mono.just(webClientResponse));
+
+ Mono employeeMono = employeeService.addNewEmployee(newEmployee);
+
+ StepVerifier.create(employeeMono)
+ .expectNextMatches(employee -> employee.getEmployeeId().equals(100))
+ .verifyComplete();
+ }
+
+ @Test
+ void givenEmployee_whenupdateEmployee_thenUpdatedEmployee() {
+
+ Integer newAge = 33;
+ String newLastName = "Sandler New";
+ Employee updateEmployee = new Employee(100, "Adam", newLastName, newAge, Role.LEAD_ENGINEER);
+ when(webClientMock.put()).thenReturn(requestBodyUriMock);
+ when(requestBodyUriMock.uri(EmployeeService.PATH_PARAM_BY_ID, 100)).thenReturn(requestBodyMock);
+ when(requestBodyMock.syncBody(updateEmployee)).thenReturn(requestHeadersMock);
+ when(requestHeadersMock.retrieve()).thenReturn(responseMock);
+ when(responseMock.bodyToMono(Employee.class)).thenReturn(Mono.just(updateEmployee));
+
+ Mono updatedEmployee = employeeService.updateEmployee(100, updateEmployee);
+
+ StepVerifier.create(updatedEmployee)
+ .expectNextMatches(employee -> employee.getLastName().equals(newLastName) && employee.getAge() == newAge)
+ .verifyComplete();
+
+ }
+
+ @Test
+ void givenEmployee_whenDeleteEmployeeById_thenDeleteSuccessful() {
+
+ String responseMessage = "Employee Deleted SuccessFully";
+ when(webClientMock.delete()).thenReturn(requestHeadersUriMock);
+ when(requestHeadersUriMock.uri(EmployeeService.PATH_PARAM_BY_ID, 100)).thenReturn(requestHeadersMock);
+ when(requestHeadersMock.retrieve()).thenReturn(responseMock);
+ when(responseMock.bodyToMono(String.class)).thenReturn(Mono.just(responseMessage));
+
+ Mono deletedEmployee = employeeService.deleteEmployeeById(100);
+
+ StepVerifier.create(deletedEmployee)
+ .expectNext(responseMessage)
+ .verifyComplete();
+ }
+}
\ No newline at end of file
diff --git a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java
new file mode 100644
index 0000000000..0acedf15b0
--- /dev/null
+++ b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java
@@ -0,0 +1,68 @@
+package com.baeldung.reactive.webclient.simultaneous;
+
+import org.junit.Test;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
+import static com.github.tomakehurst.wiremock.client.WireMock.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class ClientIntegrationTest {
+
+ private WireMockServer wireMockServer;
+
+ @Before
+ public void setup() {
+ wireMockServer = new WireMockServer(wireMockConfig().port(8089));
+ wireMockServer.start();
+ configureFor("localhost", wireMockServer.port());
+ }
+
+ @After
+ public void tearDown() {
+ wireMockServer.stop();
+ }
+
+ @Test
+ public void givenClient_whenFetchingUsers_thenExecutionTimeIsLessThanDouble() {
+ // Arrange
+ int requestsNumber = 5;
+ int singleRequestTime = 1000;
+
+ for (int i = 1; i <= requestsNumber; i++) {
+ stubFor(get(urlEqualTo("/user/" + i)).willReturn(aResponse().withFixedDelay(singleRequestTime)
+ .withStatus(200)
+ .withHeader("Content-Type", "application/json")
+ .withBody(String.format("{ \"id\": %d }", i))));
+ }
+
+ List userIds = IntStream.rangeClosed(1, requestsNumber)
+ .boxed()
+ .collect(Collectors.toList());
+
+ Client client = new Client("http://localhost:8089");
+
+ // Act
+ long start = System.currentTimeMillis();
+ List users = client.fetchUsers(userIds);
+ long end = System.currentTimeMillis();
+
+ // Assert
+ long totalExecutionTime = end - start;
+
+ assertEquals("Unexpected number of users", requestsNumber, users.size());
+ assertTrue("Execution time is too big", 2 * singleRequestTime > totalExecutionTime);
+ }
+}
diff --git a/spring-5-reactive-security/README.md b/spring-5-reactive-security/README.md
index ebb107645b..4ea6fb644f 100644
--- a/spring-5-reactive-security/README.md
+++ b/spring-5-reactive-security/README.md
@@ -7,7 +7,7 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles
-- [Spring Boot Actuator](http://www.baeldung.com/spring-boot-actuators)
-- [Spring Security 5 for Reactive Applications](http://www.baeldung.com/spring-security-5-reactive)
-- [Guide to Spring 5 WebFlux](http://www.baeldung.com/spring-webflux)
+- [Spring Boot Actuator](https://www.baeldung.com/spring-boot-actuators)
+- [Spring Security 5 for Reactive Applications](https://www.baeldung.com/spring-security-5-reactive)
+- [Guide to Spring 5 WebFlux](https://www.baeldung.com/spring-webflux)
- [Introduction to the Functional Web Framework in Spring 5](https://www.baeldung.com/spring-5-functional-web)
diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md
index b782f817ad..2bef8ee6d4 100644
--- a/spring-5-reactive/README.md
+++ b/spring-5-reactive/README.md
@@ -7,14 +7,14 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles
-- [Introduction to the Functional Web Framework in Spring 5](http://www.baeldung.com/spring-5-functional-web)
-- [Spring 5 WebClient](http://www.baeldung.com/spring-5-webclient)
-- [Exploring the Spring 5 WebFlux URL Matching](http://www.baeldung.com/spring-5-mvc-url-matching)
-- [Reactive WebSockets with Spring 5](http://www.baeldung.com/spring-5-reactive-websockets)
-- [Spring Webflux Filters](http://www.baeldung.com/spring-webflux-filters)
-- [How to Set a Header on a Response with Spring 5](http://www.baeldung.com/spring-response-header)
-- [Spring Webflux and CORS](http://www.baeldung.com/spring-webflux-cors)
-- [Handling Errors in Spring WebFlux](http://www.baeldung.com/spring-webflux-errors)
+- [Introduction to the Functional Web Framework in Spring 5](https://www.baeldung.com/spring-5-functional-web)
+- [Spring 5 WebClient](https://www.baeldung.com/spring-5-webclient)
+- [Exploring the Spring 5 WebFlux URL Matching](https://www.baeldung.com/spring-5-mvc-url-matching)
+- [Reactive WebSockets with Spring 5](https://www.baeldung.com/spring-5-reactive-websockets)
+- [Spring Webflux Filters](httpss://www.baeldung.com/spring-webflux-filters)
+- [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header)
+- [Spring Webflux and CORS](https://www.baeldung.com/spring-webflux-cors)
+- [Handling Errors in Spring WebFlux](https://www.baeldung.com/spring-webflux-errors)
- [Server-Sent Events in Spring](https://www.baeldung.com/spring-server-sent-events)
- [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive)
- [Validation for Functional Endpoints in Spring 5](https://www.baeldung.com/spring-functional-endpoints-validation)
@@ -22,4 +22,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Testing Reactive Streams Using StepVerifier and TestPublisher](https://www.baeldung.com/reactive-streams-step-verifier-test-publisher)
- [Debugging Reactive Streams in Spring 5](https://www.baeldung.com/spring-debugging-reactive-streams)
- [Static Content in Spring WebFlux](https://www.baeldung.com/spring-webflux-static-content)
-- [more...](/spring-5-reactive-2)
+- More articles: [[next -->]](/spring-5-reactive-2)
diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/errorhandling/ErrorHandlingIntegrationTest.java b/spring-5-reactive/src/test/java/com/baeldung/reactive/errorhandling/ErrorHandlingIntegrationTest.java
index 42da90ecd5..3bbbed0d77 100644
--- a/spring-5-reactive/src/test/java/com/baeldung/reactive/errorhandling/ErrorHandlingIntegrationTest.java
+++ b/spring-5-reactive/src/test/java/com/baeldung/reactive/errorhandling/ErrorHandlingIntegrationTest.java
@@ -12,11 +12,13 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.http.MediaType;
import org.springframework.security.test.context.support.WithMockUser;
+import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.reactive.server.WebTestClient;
@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@DirtiesContext
@WithMockUser
@AutoConfigureWebTestClient(timeout = "10000")
public class ErrorHandlingIntegrationTest {
diff --git a/spring-5-security-cognito/README.md b/spring-5-security-cognito/README.md
index 0825882c05..ff2784f410 100644
--- a/spring-5-security-cognito/README.md
+++ b/spring-5-security-cognito/README.md
@@ -1,3 +1,7 @@
+## Spring 5 Security Cognito
+
+This module contains articles about Spring 5 with Amazon Cognito
+
## Relevant articles:
- [Authenticating with Amazon Cognito Using Spring Security](https://www.baeldung.com/spring-security-oauth-cognito)
diff --git a/spring-5-security-oauth/README.md b/spring-5-security-oauth/README.md
index 4e080fc517..43cab33598 100644
--- a/spring-5-security-oauth/README.md
+++ b/spring-5-security-oauth/README.md
@@ -4,6 +4,6 @@ This module contains articles about Spring 5 OAuth Security
## Relevant articles:
-- [Spring Security 5 – OAuth2 Login](http://www.baeldung.com/spring-security-5-oauth2-login)
+- [Spring Security 5 – OAuth2 Login](https://www.baeldung.com/spring-security-5-oauth2-login)
- [Extracting Principal and Authorities using Spring Security OAuth](https://www.baeldung.com/spring-security-oauth-principal-authorities-extractor)
- [Customizing Authorization and Token Requests with Spring Security 5.1 Client](https://www.baeldung.com/spring-security-custom-oauth-requests)
diff --git a/spring-5-security/README.md b/spring-5-security/README.md
index 23b46f4dc9..4cace0db8d 100644
--- a/spring-5-security/README.md
+++ b/spring-5-security/README.md
@@ -4,8 +4,8 @@ This module contains articles about Spring Security 5
## Relevant articles:
-- [Extra Login Fields with Spring Security](http://www.baeldung.com/spring-security-extra-login-fields)
-- [A Custom Spring SecurityConfigurer](http://www.baeldung.com/spring-security-custom-configurer)
-- [New Password Storage In Spring Security 5](http://www.baeldung.com/spring-security-5-password-storage)
+- [Extra Login Fields with Spring Security](https://www.baeldung.com/spring-security-extra-login-fields)
+- [A Custom Spring SecurityConfigurer](https://www.baeldung.com/spring-security-custom-configurer)
+- [New Password Storage In Spring Security 5](https://www.baeldung.com/spring-security-5-password-storage)
- [Default Password Encoder in Spring Security 5](https://www.baeldung.com/spring-security-5-default-password-encoder)
diff --git a/spring-5/README.md b/spring-5/README.md
index d3c1decbc7..7588d23304 100644
--- a/spring-5/README.md
+++ b/spring-5/README.md
@@ -1,16 +1,18 @@
-## Spring REST Example Project
+## Spring 5
+
+This module contains articles about Spring 5
### The Course
The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles
-- [Concurrent Test Execution in Spring 5](http://www.baeldung.com/spring-5-concurrent-tests)
-- [Spring 5 Functional Bean Registration](http://www.baeldung.com/spring-5-functional-beans)
-- [The SpringJUnitConfig and SpringJUnitWebConfig Annotations in Spring 5](http://www.baeldung.com/spring-5-junit-config)
-- [Spring 5 Testing with @EnabledIf Annotation](http://www.baeldung.com/spring-5-enabledIf)
-- [Introduction to Spring REST Docs](http://www.baeldung.com/spring-rest-docs)
-- [Spring ResponseStatusException](http://www.baeldung.com/spring-response-status-exception)
-- [Spring Assert Statements](http://www.baeldung.com/spring-assert)
+- [Concurrent Test Execution in Spring 5](https://www.baeldung.com/spring-5-concurrent-tests)
+- [Spring 5 Functional Bean Registration](https://www.baeldung.com/spring-5-functional-beans)
+- [The SpringJUnitConfig and SpringJUnitWebConfig Annotations in Spring 5](https://www.baeldung.com/spring-5-junit-config)
+- [Spring 5 Testing with @EnabledIf Annotation](https://www.baeldung.com/spring-5-enabledIf)
+- [Introduction to Spring REST Docs](https://www.baeldung.com/spring-rest-docs)
+- [Spring ResponseStatusException](https://www.baeldung.com/spring-response-status-exception)
+- [Spring Assert Statements](https://www.baeldung.com/spring-assert)
- [Configuring a Hikari Connection Pool with Spring Boot](https://www.baeldung.com/spring-boot-hikari)
diff --git a/spring-activiti/README.md b/spring-activiti/README.md
index 703dfeec52..f4e788492b 100644
--- a/spring-activiti/README.md
+++ b/spring-activiti/README.md
@@ -1,6 +1,10 @@
+## Spring Activiti
+
+This module contains articles about Spring with Activiti
+
### Relevant articles
-- [A Guide to Activiti with Java](http://www.baeldung.com/java-activiti)
-- [Introduction to Activiti with Spring](http://www.baeldung.com/spring-activiti)
-- [Activiti with Spring Security](http://www.baeldung.com/activiti-spring-security)
-- [ProcessEngine Configuration in Activiti](http://www.baeldung.com/activiti-process-engine)
+- [A Guide to Activiti with Java](https://www.baeldung.com/java-activiti)
+- [Introduction to Activiti with Spring](https://www.baeldung.com/spring-activiti)
+- [Activiti with Spring Security](https://www.baeldung.com/activiti-spring-security)
+- [ProcessEngine Configuration in Activiti](https://www.baeldung.com/activiti-process-engine)
diff --git a/spring-akka/README.md b/spring-akka/README.md
index 0f1c013214..c7db5d5c01 100644
--- a/spring-akka/README.md
+++ b/spring-akka/README.md
@@ -1,2 +1,6 @@
+## Spring Akka
+
+This module contains articles about Spring with Akka
+
### Relevant Articles:
-- [Introduction to Spring with Akka](http://www.baeldung.com/akka-with-spring)
+- [Introduction to Spring with Akka](https://www.baeldung.com/akka-with-spring)
diff --git a/spring-all/README.md b/spring-all/README.md
index c5825b47fb..1d6cb0bfad 100644
--- a/spring-all/README.md
+++ b/spring-all/README.md
@@ -1,5 +1,3 @@
-=========
-
## Spring General Example Project
This project is used to replicate Spring Exceptions only.
@@ -10,26 +8,26 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant articles:
-- [Guide to Spring @Autowired](http://www.baeldung.com/spring-autowire)
-- [Spring Profiles](http://www.baeldung.com/spring-profiles)
-- [A Spring Custom Annotation for a Better DAO](http://www.baeldung.com/spring-annotation-bean-pre-processor)
-- [What’s New in Spring 4.3?](http://www.baeldung.com/whats-new-in-spring-4-3)
-- [Running Setup Data on Startup in Spring](http://www.baeldung.com/running-setup-logic-on-startup-in-spring)
-- [Quick Guide to Spring Controllers](http://www.baeldung.com/spring-controllers)
-- [Quick Guide to Spring Bean Scopes](http://www.baeldung.com/spring-bean-scopes)
-- [Introduction To Ehcache](http://www.baeldung.com/ehcache)
-- [A Guide to the Spring Task Scheduler](http://www.baeldung.com/spring-task-scheduler)
-- [Guide to Spring Retry](http://www.baeldung.com/spring-retry)
-- [Custom Scope in Spring](http://www.baeldung.com/spring-custom-scope)
-- [A CLI with Spring Shell](http://www.baeldung.com/spring-shell-cli)
-- [JasperReports with Spring](http://www.baeldung.com/spring-jasper)
-- [Model, ModelMap, and ModelView in Spring MVC](http://www.baeldung.com/spring-mvc-model-model-map-model-view)
-- [A Guide To Caching in Spring](http://www.baeldung.com/spring-cache-tutorial)
-- [How To Do @Async in Spring](http://www.baeldung.com/spring-async)
-- [@Order in Spring](http://www.baeldung.com/spring-order)
-- [Spring Web Contexts](http://www.baeldung.com/spring-web-contexts)
-- [Spring Cache – Creating a Custom KeyGenerator](http://www.baeldung.com/spring-cache-custom-keygenerator)
-- [Spring @Primary Annotation](http://www.baeldung.com/spring-primary)
+- [Guide to Spring @Autowired](https://www.baeldung.com/spring-autowire)
+- [Spring Profiles](https://www.baeldung.com/spring-profiles)
+- [A Spring Custom Annotation for a Better DAO](https://www.baeldung.com/spring-annotation-bean-pre-processor)
+- [What’s New in Spring 4.3?](https://www.baeldung.com/whats-new-in-spring-4-3)
+- [Running Setup Data on Startup in Spring](https://www.baeldung.com/running-setup-logic-on-startup-in-spring)
+- [Quick Guide to Spring Controllers](https://www.baeldung.com/spring-controllers)
+- [Quick Guide to Spring Bean Scopes](https://www.baeldung.com/spring-bean-scopes)
+- [Introduction To Ehcache](https://www.baeldung.com/ehcache)
+- [A Guide to the Spring Task Scheduler](https://www.baeldung.com/spring-task-scheduler)
+- [Guide to Spring Retry](https://www.baeldung.com/spring-retry)
+- [Custom Scope in Spring](https://www.baeldung.com/spring-custom-scope)
+- [A CLI with Spring Shell](https://www.baeldung.com/spring-shell-cli)
+- [JasperReports with Spring](https://www.baeldung.com/spring-jasper)
+- [Model, ModelMap, and ModelView in Spring MVC](https://www.baeldung.com/spring-mvc-model-model-map-model-view)
+- [A Guide To Caching in Spring](https://www.baeldung.com/spring-cache-tutorial)
+- [How To Do @Async in Spring](https://www.baeldung.com/spring-async)
+- [@Order in Spring](https://www.baeldung.com/spring-order)
+- [Spring Web Contexts](https://www.baeldung.com/spring-web-contexts)
+- [Spring Cache – Creating a Custom KeyGenerator](https://www.baeldung.com/spring-cache-custom-keygenerator)
+- [Spring @Primary Annotation](https://www.baeldung.com/spring-primary)
- [Spring Events](https://www.baeldung.com/spring-events)
- [Spring Null-Safety Annotations](https://www.baeldung.com/spring-null-safety-annotations)
- [Using @Autowired in Abstract Classes](https://www.baeldung.com/spring-autowired-abstract-class)
diff --git a/spring-amqp/README.md b/spring-amqp/README.md
index 5e29011995..0ae4eda12e 100644
--- a/spring-amqp/README.md
+++ b/spring-amqp/README.md
@@ -1,3 +1,7 @@
+## Spring AMQP
+
+This module contains articles about Spring with the AMQP messaging system
+
## Relevant articles:
- [Messaging With Spring AMQP](https://www.baeldung.com/spring-amqp)
diff --git a/spring-aop/README.md b/spring-aop/README.md
index af8ab71da0..061e736d31 100644
--- a/spring-aop/README.md
+++ b/spring-aop/README.md
@@ -1,6 +1,10 @@
+## Spring AOP
+
+This module contains articles about Spring aspect oriented programming (AOP)
+
### Relevant articles
-- [Implementing a Custom Spring AOP Annotation](http://www.baeldung.com/spring-aop-annotation)
-- [Intro to AspectJ](http://www.baeldung.com/aspectj)
-- [Spring Performance Logging](http://www.baeldung.com/spring-performance-logging)
-- [Introduction to Spring AOP](http://www.baeldung.com/spring-aop)
+- [Implementing a Custom Spring AOP Annotation](https://www.baeldung.com/spring-aop-annotation)
+- [Intro to AspectJ](https://www.baeldung.com/aspectj)
+- [Spring Performance Logging](https://www.baeldung.com/spring-performance-logging)
+- [Introduction to Spring AOP](https://www.baeldung.com/spring-aop)
diff --git a/spring-apache-camel/README.md b/spring-apache-camel/README.md
index e72e18b198..e89eb4fe6c 100644
--- a/spring-apache-camel/README.md
+++ b/spring-apache-camel/README.md
@@ -1,35 +1,26 @@
+## Spring Apache Camel
-
Configure and Use Apache Camel with Spring
+This module contains articles about Spring with Apache Camel
-This article will demonstrate how to configure and use Apache Camel with Spring Framework.
+### Relevant Articles
-
Relevant Articles
+- [Apache Camel](http://camel.apache.org/)
+- [Enterprise Integration Patterns](http://www.enterpriseintegrationpatterns.com/patterns/messaging/toc.html)
+- [Introduction To Apache Camel](http://www.baeldung.com/apache-camel-intro)
+- [Integration Patterns With Apache Camel](http://www.baeldung.com/camel-integration-patterns)
+- [Using Apache Camel with Spring](http://www.baeldung.com/spring-apache-camel-tutorial)
-
+To build this application execute:
-To build this application execute following maven command in ApacheCamelFileProcessor directory.
-
-mvn clean install
+`mvn clean install`
To run this application you can either run our main class App from your IDE or you can execute following maven command:
-mvn exec:java -Dexec.mainClass="App"
-
-