diff --git a/algorithms/README.md b/algorithms/README.md
index 47ddd7028a..9b3bbcdee5 100644
--- a/algorithms/README.md
+++ b/algorithms/README.md
@@ -24,3 +24,7 @@
- [Practical Java Examples of the Big O Notation](http://www.baeldung.com/java-algorithm-complexity)
- [Find the Middle Element of a Linked List](http://www.baeldung.com/java-linked-list-middle-element)
- [An Introduction to the Theory of Big-O Notation](http://www.baeldung.com/big-o-notation)
+- [Check If Two Rectangles Overlap In Java](https://www.baeldung.com/java-check-if-two-rectangles-overlap)
+- [Calculate the Distance Between Two Points in Java](https://www.baeldung.com/java-distance-between-two-points)
+- [Find the Intersection of Two Lines in Java](https://www.baeldung.com/java-intersection-of-two-lines)
+- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters)
diff --git a/asciidoctor/README.md b/asciidoctor/README.md
index aafd0bca17..2124907e87 100644
--- a/asciidoctor/README.md
+++ b/asciidoctor/README.md
@@ -1,5 +1,4 @@
### Relevant articles
-- [Introduction to Asciidoctor](http://www.baeldung.com/introduction-to-asciidoctor)
- [Generating a Book with Asciidoctor](http://www.baeldung.com/asciidoctor-book)
- [Introduction to Asciidoctor in Java](http://www.baeldung.com/asciidoctor)
diff --git a/asciidoctor/pom.xml b/asciidoctor/pom.xml
index 15de5ac913..42ee544eb0 100644
--- a/asciidoctor/pom.xml
+++ b/asciidoctor/pom.xml
@@ -61,9 +61,10 @@
- 1.5.5
- 1.5.4
- 1.5.0-alpha.11
+ 1.5.6
+ 1.5.6
+
+ 1.5.0-alpha.15
1.5.0-alpha.15
diff --git a/asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoTest.java b/asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoIntegrationTest.java
similarity index 89%
rename from asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoTest.java
rename to asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoIntegrationTest.java
index 3e312eb059..c4129e6441 100644
--- a/asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoTest.java
+++ b/asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoIntegrationTest.java
@@ -3,7 +3,7 @@ package com.baeldung.asciidoctor;
import org.junit.Assert;
import org.junit.Test;
-public class AsciidoctorDemoTest {
+public class AsciidoctorDemoIntegrationTest {
@Test
public void givenString_whenConverting_thenResultingHTMLCode() {
diff --git a/cdi-portable-extension/flyway-cdi/pom.xml b/cdi-portable-extension/flyway-cdi/pom.xml
new file mode 100644
index 0000000000..9fb781aaab
--- /dev/null
+++ b/cdi-portable-extension/flyway-cdi/pom.xml
@@ -0,0 +1,38 @@
+
+
+ 4.0.0
+
+ flyway-cdi
+
+
+ com.baeldung
+ cdi-portable-extension
+ 1.0-SNAPSHOT
+
+
+
+
+ javax.enterprise
+ cdi-api
+ 2.0.SP1
+
+
+ org.flywaydb
+ flyway-core
+ 5.1.4
+
+
+ org.apache.tomcat
+ tomcat-jdbc
+ 8.5.33
+
+
+ javax.annotation
+ javax.annotation-api
+ 1.3.2
+
+
+
+
diff --git a/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayExtension.java b/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayExtension.java
new file mode 100644
index 0000000000..a5019b82c1
--- /dev/null
+++ b/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayExtension.java
@@ -0,0 +1,74 @@
+package com.baeldung.cdi.extension;
+
+import org.apache.tomcat.jdbc.pool.DataSource;
+import org.flywaydb.core.Flyway;
+
+import javax.annotation.sql.DataSourceDefinition;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Default;
+import javax.enterprise.inject.literal.InjectLiteral;
+import javax.enterprise.inject.spi.*;
+import javax.enterprise.util.AnnotationLiteral;
+
+
+/**
+ * Flyway is now under CDI container like:
+ *
+ * @ApplicationScoped
+ * @FlywayType public class Flyway{
+ * @Inject setDataSource(DataSource dataSource){
+ * //...
+ * }
+ * }
+ */
+
+public class FlywayExtension implements Extension {
+
+ DataSourceDefinition dataSourceDefinition = null;
+
+ public void registerFlywayType(@Observes BeforeBeanDiscovery bbdEvent) {
+ bbdEvent.addAnnotatedType(Flyway.class, Flyway.class.getName());
+ }
+
+ public void detectDataSourceDefinition(@Observes @WithAnnotations(DataSourceDefinition.class) ProcessAnnotatedType> patEvent) {
+ AnnotatedType at = patEvent.getAnnotatedType();
+ dataSourceDefinition = at.getAnnotation(DataSourceDefinition.class);
+ }
+
+ public void processAnnotatedType(@Observes ProcessAnnotatedType patEvent) {
+ patEvent.configureAnnotatedType()
+ //Add Scope
+ .add(ApplicationScoped.Literal.INSTANCE)
+ //Add Qualifier
+ .add(new AnnotationLiteral() {
+ })
+ //Decorate setDataSource(DataSource dataSource){} with @Inject
+ .filterMethods(annotatedMethod -> {
+ return annotatedMethod.getParameters().size() == 1 &&
+ annotatedMethod.getParameters().get(0).getBaseType().equals(javax.sql.DataSource.class);
+ })
+ .findFirst().get().add(InjectLiteral.INSTANCE);
+ }
+
+ void afterBeanDiscovery(@Observes AfterBeanDiscovery abdEvent, BeanManager bm) {
+ abdEvent.addBean()
+ .types(javax.sql.DataSource.class, DataSource.class)
+ .qualifiers(new AnnotationLiteral() {}, new AnnotationLiteral() {})
+ .scope(ApplicationScoped.class)
+ .name(DataSource.class.getName())
+ .beanClass(DataSource.class)
+ .createWith(creationalContext -> {
+ DataSource instance = new DataSource();
+ instance.setUrl(dataSourceDefinition.url());
+ instance.setDriverClassName(dataSourceDefinition.className());
+ return instance;
+ });
+ }
+
+ void runFlywayMigration(@Observes AfterDeploymentValidation adv, BeanManager manager) {
+ Flyway flyway = manager.createInstance().select(Flyway.class, new AnnotationLiteral() {}).get();
+ flyway.migrate();
+ }
+}
diff --git a/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayType.java b/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayType.java
new file mode 100644
index 0000000000..7c3a5affa6
--- /dev/null
+++ b/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayType.java
@@ -0,0 +1,14 @@
+package com.baeldung.cdi.extension;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({FIELD, METHOD, PARAMETER, TYPE})
+@Qualifier
+public @interface FlywayType {
+}
\ No newline at end of file
diff --git a/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/beans.xml b/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000000..44959bfa99
--- /dev/null
+++ b/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,6 @@
+
+
\ No newline at end of file
diff --git a/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100644
index 0000000000..a82dc47714
--- /dev/null
+++ b/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1,2 @@
+com.baeldung.cdi.extension.FlywayExtension
+
diff --git a/cdi-portable-extension/main-app/pom.xml b/cdi-portable-extension/main-app/pom.xml
new file mode 100644
index 0000000000..fab9b8bf07
--- /dev/null
+++ b/cdi-portable-extension/main-app/pom.xml
@@ -0,0 +1,52 @@
+
+
+ 4.0.0
+
+ main-app
+ jar
+
+
+ com.baeldung
+ cdi-portable-extension
+ 1.0-SNAPSHOT
+
+
+
+
+
+ javax.enterprise
+ cdi-api
+ 2.0.SP1
+
+
+ org.jboss.weld.se
+ weld-se-core
+ 3.0.5.Final
+ runtime
+
+
+
+ com.baeldung
+ flyway-cdi
+ 1.0-SNAPSHOT
+ runtime
+
+
+
+ com.h2database
+ h2
+ 1.4.197
+ runtime
+
+
+
+ javax.annotation
+ javax.annotation-api
+ 1.3.2
+
+
+
+
+
\ No newline at end of file
diff --git a/cdi-portable-extension/main-app/src/main/java/com/baeldung/cdi/extension/MainApp.java b/cdi-portable-extension/main-app/src/main/java/com/baeldung/cdi/extension/MainApp.java
new file mode 100644
index 0000000000..1f6c5b43ba
--- /dev/null
+++ b/cdi-portable-extension/main-app/src/main/java/com/baeldung/cdi/extension/MainApp.java
@@ -0,0 +1,16 @@
+package com.baeldung.cdi.extension;
+
+import javax.annotation.sql.DataSourceDefinition;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.se.SeContainer;
+import javax.enterprise.inject.se.SeContainerInitializer;
+
+@ApplicationScoped
+@DataSourceDefinition(name = "ds", className = "org.h2.Driver", url = "jdbc:h2:mem:testdb")
+public class MainApp {
+ public static void main(String[] args) {
+ SeContainerInitializer initializer = SeContainerInitializer.newInstance();
+ try (SeContainer container = initializer.initialize()) {
+ }
+ }
+}
\ No newline at end of file
diff --git a/cdi-portable-extension/main-app/src/main/resources/META-INF/beans.xml b/cdi-portable-extension/main-app/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000000..44959bfa99
--- /dev/null
+++ b/cdi-portable-extension/main-app/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,6 @@
+
+
\ No newline at end of file
diff --git a/cdi-portable-extension/main-app/src/main/resources/db/migration/V1__Create_person_table.sql b/cdi-portable-extension/main-app/src/main/resources/db/migration/V1__Create_person_table.sql
new file mode 100644
index 0000000000..6bddc7689e
--- /dev/null
+++ b/cdi-portable-extension/main-app/src/main/resources/db/migration/V1__Create_person_table.sql
@@ -0,0 +1,4 @@
+create table PERSON (
+ ID int not null,
+ NAME varchar(100) not null
+);
diff --git a/cdi-portable-extension/main-app/src/main/resources/db/migration/V2__Add_people.sql b/cdi-portable-extension/main-app/src/main/resources/db/migration/V2__Add_people.sql
new file mode 100644
index 0000000000..d8f1d62667
--- /dev/null
+++ b/cdi-portable-extension/main-app/src/main/resources/db/migration/V2__Add_people.sql
@@ -0,0 +1,3 @@
+insert into PERSON (ID, NAME) values (1, 'Axel');
+insert into PERSON (ID, NAME) values (2, 'Mr. Foo');
+insert into PERSON (ID, NAME) values (3, 'Ms. Bar');
diff --git a/cdi-portable-extension/pom.xml b/cdi-portable-extension/pom.xml
new file mode 100644
index 0000000000..66913de84d
--- /dev/null
+++ b/cdi-portable-extension/pom.xml
@@ -0,0 +1,30 @@
+
+
+ 4.0.0
+
+ com.baeldung
+ cdi-portable-extension
+ 1.0-SNAPSHOT
+ pom
+
+
+ 1.8
+ 1.8
+
+
+
+ main-app
+ flyway-cdi
+
+
+
+
+ javax.enterprise
+ cdi-api
+ 2.0.SP1
+
+
+
+
\ No newline at end of file
diff --git a/core-java-collections/README.md b/core-java-collections/README.md
index f187141712..ca275d7c09 100644
--- a/core-java-collections/README.md
+++ b/core-java-collections/README.md
@@ -48,4 +48,6 @@
- [Thread Safe LIFO Data Structure Implementations](https://www.baeldung.com/java-lifo-thread-safe)
- [Collections.emptyList() vs. New List Instance](https://www.baeldung.com/java-collections-emptylist-new-list)
- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap)
-- [](https://www.baeldung.com/java-hashset-arraylist-contains-performance)
+- [Performance of contains() in a HashSet vs ArrayList](https://www.baeldung.com/java-hashset-arraylist-contains-performance)
+- [Get the Key for a Value from a Java Map](https://www.baeldung.com/java-map-key-from-value)
+- [Time Complexity of Java Collections](https://www.baeldung.com/java-collections-complexity)
diff --git a/core-java-collections/pom.xml b/core-java-collections/pom.xml
index 92e4278593..d0c3c25beb 100644
--- a/core-java-collections/pom.xml
+++ b/core-java-collections/pom.xml
@@ -63,6 +63,12 @@
jmh-generator-annprocess
${openjdk.jmh.version}
+
+ org.apache.commons
+ commons-exec
+ 1.3
+
+
diff --git a/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java b/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java
new file mode 100644
index 0000000000..2ad48033c0
--- /dev/null
+++ b/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java
@@ -0,0 +1,39 @@
+package com.baeldung.combiningcollections;
+
+import java.util.Arrays;
+import java.util.stream.Stream;
+
+import org.apache.commons.lang3.ArrayUtils;
+
+import com.google.common.collect.ObjectArrays;
+
+public class CombiningArrays {
+
+ public static Object[] usingNativeJava(Object[] first, Object[] second) {
+ Object[] combined = new Object[first.length + second.length];
+ System.arraycopy(first, 0, combined, 0, first.length);
+ System.arraycopy(second, 0, combined, first.length, second.length);
+ return combined;
+ }
+
+ public static Object[] usingJava8ObjectStream(Object[] first, Object[] second) {
+ Object[] combined = Stream.concat(Arrays.stream(first), Arrays.stream(second)).toArray();
+ return combined;
+ }
+
+ public static Object[] usingJava8FlatMaps(Object[] first, Object[] second) {
+ Object[] combined = Stream.of(first, second).flatMap(Stream::of).toArray(String[]::new);
+ return combined;
+ }
+
+ public static Object[] usingApacheCommons(Object[] first, Object[] second) {
+ Object[] combined = ArrayUtils.addAll(first, second);
+ return combined;
+ }
+
+ public static Object[] usingGuava(Object[] first, Object[] second) {
+ Object [] combined = ObjectArrays.concat(first, second, Object.class);
+ return combined;
+ }
+
+}
diff --git a/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java b/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java
new file mode 100644
index 0000000000..3fdf672758
--- /dev/null
+++ b/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java
@@ -0,0 +1,46 @@
+package com.baeldung.combiningcollections;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.apache.commons.collections4.ListUtils;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
+public class CombiningLists {
+
+ public static List