From ebc25b2b41a765b3503b1de50e17c5fc8090501a Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Mon, 27 Nov 2017 15:56:07 +0200 Subject: [PATCH 1/5] minor cleanup work --- bootique/dependency-reduced-pom.xml | 8 +++++++- ...yAnnotationJavaConfigMainIntegrationTest.java | 16 ++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/bootique/dependency-reduced-pom.xml b/bootique/dependency-reduced-pom.xml index ed18f4e42a..ab09cfb7b1 100644 --- a/bootique/dependency-reduced-pom.xml +++ b/bootique/dependency-reduced-pom.xml @@ -28,8 +28,14 @@ junit junit - 3.8.1 + 4.12 test + + + hamcrest-core + org.hamcrest + + diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/manytomany/HibernateManyToManyAnnotationJavaConfigMainIntegrationTest.java b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/manytomany/HibernateManyToManyAnnotationJavaConfigMainIntegrationTest.java index 61d821e85e..614de6d3ad 100644 --- a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/manytomany/HibernateManyToManyAnnotationJavaConfigMainIntegrationTest.java +++ b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/manytomany/HibernateManyToManyAnnotationJavaConfigMainIntegrationTest.java @@ -1,6 +1,5 @@ package com.baeldung.hibernate.manytomany; - import java.util.HashSet; import java.util.Set; import org.hibernate.Session; @@ -17,10 +16,8 @@ import com.baeldung.hibernate.manytomany.model.Employee; import com.baeldung.hibernate.manytomany.model.Project; import com.baeldung.manytomany.spring.PersistenceConfig; - - @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = {PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) +@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) public class HibernateManyToManyAnnotationJavaConfigMainIntegrationTest { @Autowired @@ -28,7 +25,6 @@ public class HibernateManyToManyAnnotationJavaConfigMainIntegrationTest { private Session session; - @Before public final void before() { session = sessionFactory.openSession(); @@ -43,11 +39,11 @@ public class HibernateManyToManyAnnotationJavaConfigMainIntegrationTest { @Test public final void whenEntitiesAreCreated_thenNoExceptions() { - Set projects = new HashSet(); - projects.add(new Project("IT Project")); - projects.add(new Project("Networking Project")); - session.persist(new Employee("Peter", "Oven", projects)); - session.persist(new Employee("Allan", "Norman", projects)); + Set projects = new HashSet(); + projects.add(new Project("IT Project")); + projects.add(new Project("Networking Project")); + session.persist(new Employee("Peter", "Oven", projects)); + session.persist(new Employee("Allan", "Norman", projects)); } } From bac574a7c22d2a20730ebbce70b51a7c90d46f47 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Mon, 27 Nov 2017 16:08:53 +0200 Subject: [PATCH 2/5] cleanup work after build --- undertow/dependency-reduced-pom.xml | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 undertow/dependency-reduced-pom.xml diff --git a/undertow/dependency-reduced-pom.xml b/undertow/dependency-reduced-pom.xml new file mode 100644 index 0000000000..0654c82b74 --- /dev/null +++ b/undertow/dependency-reduced-pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + com.baeldung.undertow + undertow + undertow + 1.0-SNAPSHOT + http://maven.apache.org + + ${project.artifactId} + + + maven-shade-plugin + + + package + + shade + + + + + + maven-jar-plugin + + + + com.baeldung.undertow.SimpleServer + + + + + + + + 1.8 + 1.8 + + + From 7f2ace0da913567513f9c4d6a2da15639054be86 Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Mon, 27 Nov 2017 21:02:42 +0100 Subject: [PATCH 3/5] FilesTest fix (#3146) * FilesTest fix * StopThreadTest fix --- .../concurrent/stopping/StopThreadTest.java | 14 ++-- .../baeldung/file/FileOutputStreamTest.java | 36 ---------- .../java/com/baeldung/file/FileUtilsTest.java | 37 ---------- .../com/baeldung/file/FileWriterTest.java | 40 ----------- .../java/com/baeldung/file/FilesTest.java | 68 +++++++++++++++++-- .../java/com/baeldung/file/GuavaTest.java | 48 ------------- 6 files changed, 72 insertions(+), 171 deletions(-) delete mode 100644 core-java/src/test/java/com/baeldung/file/FileOutputStreamTest.java delete mode 100644 core-java/src/test/java/com/baeldung/file/FileUtilsTest.java delete mode 100644 core-java/src/test/java/com/baeldung/file/FileWriterTest.java delete mode 100644 core-java/src/test/java/com/baeldung/file/GuavaTest.java diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/stopping/StopThreadTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/stopping/StopThreadTest.java index 8c1bdbf787..70854f013f 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/stopping/StopThreadTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/stopping/StopThreadTest.java @@ -1,7 +1,11 @@ package com.baeldung.concurrent.stopping; +import com.jayway.awaitility.Awaitility; import org.junit.Test; +import java.util.concurrent.TimeUnit; + +import static com.jayway.awaitility.Awaitility.await; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -22,11 +26,10 @@ public class StopThreadTest { // Stop it and make sure the flags have been reversed controlSubThread.stop(); - Thread.sleep(interval); - assertTrue(controlSubThread.isStopped()); + await() + .until(() -> assertTrue(controlSubThread.isStopped())); } - @Test public void whenInterruptedThreadIsStopped() throws InterruptedException { @@ -44,7 +47,8 @@ public class StopThreadTest { controlSubThread.interrupt(); // Wait less than the time we would normally sleep, and make sure we exited. - Thread.sleep(interval/10); - assertTrue(controlSubThread.isStopped()); + Awaitility.await() + .atMost(interval/ 10, TimeUnit.MILLISECONDS) + .until(controlSubThread::isStopped); } } diff --git a/core-java/src/test/java/com/baeldung/file/FileOutputStreamTest.java b/core-java/src/test/java/com/baeldung/file/FileOutputStreamTest.java deleted file mode 100644 index 451c1b4c4d..0000000000 --- a/core-java/src/test/java/com/baeldung/file/FileOutputStreamTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.baeldung.file; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.PrintWriter; - -import org.junit.After; -import org.junit.Test; - -import com.baeldung.util.StreamUtils; - -public class FileOutputStreamTest { - - public static final String fileName = "src/main/resources/countries.properties"; - - @Test - public void whenAppendToFileUsingFileOutputStream_thenCorrect() throws Exception { - FileOutputStream fos = new FileOutputStream(fileName, true); - fos.write("Spain\r\n".getBytes()); - fos.close(); - - assertThat(StreamUtils.getStringFromInputStream( - new FileInputStream(fileName))) - .isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); - } - - @After - public void revertFile() throws IOException { - PrintWriter writer = new PrintWriter(fileName); - writer.print("UK\r\n" + "US\r\n" + "Germany\r\n"); - writer.close(); - } -} diff --git a/core-java/src/test/java/com/baeldung/file/FileUtilsTest.java b/core-java/src/test/java/com/baeldung/file/FileUtilsTest.java deleted file mode 100644 index 9ee8726575..0000000000 --- a/core-java/src/test/java/com/baeldung/file/FileUtilsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.baeldung.file; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.charset.StandardCharsets; - -import org.apache.commons.io.FileUtils; -import org.junit.After; -import org.junit.Test; - -import com.baeldung.util.StreamUtils; - -public class FileUtilsTest { - - public static final String fileName = "src/main/resources/countries.properties"; - - @Test - public void whenAppendToFileUsingFiles_thenCorrect() throws IOException { - File file = new File(fileName); - FileUtils.writeStringToFile(file, "Spain\r\n", StandardCharsets.UTF_8, true); - - assertThat(StreamUtils.getStringFromInputStream( - new FileInputStream(fileName))) - .isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); - } - - @After - public void revertFile() throws IOException { - PrintWriter writer = new PrintWriter(fileName); - writer.print("UK\r\n" + "US\r\n" + "Germany\r\n"); - writer.close(); - } -} diff --git a/core-java/src/test/java/com/baeldung/file/FileWriterTest.java b/core-java/src/test/java/com/baeldung/file/FileWriterTest.java deleted file mode 100644 index 8d2ce4310e..0000000000 --- a/core-java/src/test/java/com/baeldung/file/FileWriterTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.baeldung.file; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.BufferedWriter; -import java.io.FileInputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; - -import org.junit.After; -import org.junit.Test; - -import com.baeldung.util.StreamUtils; - -public class FileWriterTest { - - public static final String fileName = "src/main/resources/countries.properties"; - - @Test - public void whenAppendToFileUsingFileWriter_thenCorrect() throws IOException { - FileWriter fw = new FileWriter(fileName, true); - BufferedWriter bw = new BufferedWriter(fw); - bw.write("Spain"); - bw.newLine(); - bw.close(); - - assertThat( - StreamUtils.getStringFromInputStream( - new FileInputStream(fileName))) - .isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\n"); - } - - @After - public void revertFile() throws IOException { - PrintWriter writer = new PrintWriter(fileName); - writer.print("UK\r\n" + "US\r\n" + "Germany\r\n"); - writer.close(); - } -} diff --git a/core-java/src/test/java/com/baeldung/file/FilesTest.java b/core-java/src/test/java/com/baeldung/file/FilesTest.java index bd39d004d3..e17e8580aa 100644 --- a/core-java/src/test/java/com/baeldung/file/FilesTest.java +++ b/core-java/src/test/java/com/baeldung/file/FilesTest.java @@ -2,14 +2,24 @@ package com.baeldung.file; import static org.assertj.core.api.Assertions.assertThat; +import java.io.BufferedWriter; +import java.io.File; import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; +import com.google.common.base.Charsets; +import com.google.common.io.CharSink; +import com.google.common.io.FileWriteMode; +import org.apache.commons.io.FileUtils; import org.junit.After; +import org.junit.Before; import org.junit.Test; import com.baeldung.util.StreamUtils; @@ -18,6 +28,26 @@ public class FilesTest { public static final String fileName = "src/main/resources/countries.properties"; + @Before + @After + public void setup() throws Exception { + PrintWriter writer = new PrintWriter(fileName); + writer.print("UK\r\n" + "US\r\n" + "Germany\r\n"); + writer.close(); + } + + @Test + public void whenAppendToFileUsingGuava_thenCorrect() throws IOException { + File file = new File(fileName); + CharSink chs = com.google.common.io.Files.asCharSink(file, Charsets.UTF_8, FileWriteMode.APPEND); + chs.write("Spain\r\n"); + + assertThat(StreamUtils.getStringFromInputStream( + new FileInputStream(fileName))) + .isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); + } + + @Test public void whenAppendToFileUsingFiles_thenCorrect() throws IOException { Files.write(Paths.get(fileName), "Spain\r\n".getBytes(), StandardOpenOption.APPEND); @@ -27,10 +57,38 @@ public class FilesTest { .isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); } - @After - public void revertFile() throws IOException { - PrintWriter writer = new PrintWriter(fileName); - writer.print("UK\r\n" + "US\r\n" + "Germany\r\n"); - writer.close(); + @Test + public void whenAppendToFileUsingFileUtils_thenCorrect() throws IOException { + File file = new File(fileName); + FileUtils.writeStringToFile(file, "Spain\r\n", StandardCharsets.UTF_8, true); + + assertThat(StreamUtils.getStringFromInputStream( + new FileInputStream(fileName))) + .isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); + } + + @Test + public void whenAppendToFileUsingFileOutputStream_thenCorrect() throws Exception { + FileOutputStream fos = new FileOutputStream(fileName, true); + fos.write("Spain\r\n".getBytes()); + fos.close(); + + assertThat(StreamUtils.getStringFromInputStream( + new FileInputStream(fileName))) + .isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); + } + + @Test + public void whenAppendToFileUsingFileWriter_thenCorrect() throws IOException { + FileWriter fw = new FileWriter(fileName, true); + BufferedWriter bw = new BufferedWriter(fw); + bw.write("Spain"); + bw.newLine(); + bw.close(); + + assertThat( + StreamUtils.getStringFromInputStream( + new FileInputStream(fileName))) + .isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\n"); } } diff --git a/core-java/src/test/java/com/baeldung/file/GuavaTest.java b/core-java/src/test/java/com/baeldung/file/GuavaTest.java deleted file mode 100644 index 5a7ec6c4a8..0000000000 --- a/core-java/src/test/java/com/baeldung/file/GuavaTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.baeldung.file; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.PrintWriter; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.baeldung.util.StreamUtils; -import com.google.common.base.Charsets; -import com.google.common.io.CharSink; -import com.google.common.io.FileWriteMode; -import com.google.common.io.Files; - -public class GuavaTest { - - public static final String fileName = "src/main/resources/countries.properties"; - - @Before - public void setup() throws Exception { - PrintWriter writer = new PrintWriter(fileName); - writer.print("UK\r\n" + "US\r\n" + "Germany\r\n"); - writer.close(); - } - - @Test - public void whenAppendToFileUsingGuava_thenCorrect() throws IOException { - File file = new File(fileName); - CharSink chs = Files.asCharSink(file, Charsets.UTF_8, FileWriteMode.APPEND); - chs.write("Spain\r\n"); - - assertThat(StreamUtils.getStringFromInputStream( - new FileInputStream(fileName))) - .isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); - } - - @After - public void revertFile() throws IOException { - PrintWriter writer = new PrintWriter(fileName); - writer.print("UK\r\n" + "US\r\n" + "Germany\r\n"); - writer.close(); - } -} From 5f57a6cb4bfb7aecd3bba2245f6caf472015279d Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Tue, 28 Nov 2017 12:36:54 +0200 Subject: [PATCH 4/5] separating the sun specific functionality into a new module --- core-java-sun/.gitignore | 26 + core-java-sun/README.md | 123 +++++ core-java-sun/pom.xml | 489 ++++++++++++++++++ .../src/main/java/com/baeldung/.gitignore | 13 + .../src/main/java/com/baeldung/README.md | 2 + .../java/com/baeldung/javac/Positive.java | 0 .../com/baeldung/javac/SampleJavacPlugin.java | 0 .../src/main/resources/log4j.properties | 6 + core-java-sun/src/main/resources/logback.xml | 19 + .../SampleJavacPluginIntegrationTest.java | 0 .../com/baeldung/javac/SimpleClassFile.java | 0 .../com/baeldung/javac/SimpleFileManager.java | 0 .../com/baeldung/javac/SimpleSourceFile.java | 0 .../java/com/baeldung/javac/TestCompiler.java | 0 .../java/com/baeldung/javac/TestRunner.java | 0 core-java-sun/src/test/resources/.gitignore | 13 + core-java/pom.xml | 12 - 17 files changed, 691 insertions(+), 12 deletions(-) create mode 100644 core-java-sun/.gitignore create mode 100644 core-java-sun/README.md create mode 100644 core-java-sun/pom.xml create mode 100644 core-java-sun/src/main/java/com/baeldung/.gitignore create mode 100644 core-java-sun/src/main/java/com/baeldung/README.md rename {core-java => core-java-sun}/src/main/java/com/baeldung/javac/Positive.java (100%) rename {core-java => core-java-sun}/src/main/java/com/baeldung/javac/SampleJavacPlugin.java (100%) create mode 100644 core-java-sun/src/main/resources/log4j.properties create mode 100644 core-java-sun/src/main/resources/logback.xml rename {core-java => core-java-sun}/src/test/java/com/baeldung/javac/SampleJavacPluginIntegrationTest.java (100%) rename {core-java => core-java-sun}/src/test/java/com/baeldung/javac/SimpleClassFile.java (100%) rename {core-java => core-java-sun}/src/test/java/com/baeldung/javac/SimpleFileManager.java (100%) rename {core-java => core-java-sun}/src/test/java/com/baeldung/javac/SimpleSourceFile.java (100%) rename {core-java => core-java-sun}/src/test/java/com/baeldung/javac/TestCompiler.java (100%) rename {core-java => core-java-sun}/src/test/java/com/baeldung/javac/TestRunner.java (100%) create mode 100644 core-java-sun/src/test/resources/.gitignore diff --git a/core-java-sun/.gitignore b/core-java-sun/.gitignore new file mode 100644 index 0000000000..3de4cc647e --- /dev/null +++ b/core-java-sun/.gitignore @@ -0,0 +1,26 @@ +*.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 +*.txt +backup-pom.xml +/bin/ +/temp + +#IntelliJ specific +.idea/ +*.iml \ No newline at end of file diff --git a/core-java-sun/README.md b/core-java-sun/README.md new file mode 100644 index 0000000000..1feee4126e --- /dev/null +++ b/core-java-sun/README.md @@ -0,0 +1,123 @@ +========= + +## Core Java Cookbooks and Examples + +### Relevant Articles: +- [Immutable ArrayList in Java](http://www.baeldung.com/java-immutable-list) +- [Java - Reading a Large File Efficiently](http://www.baeldung.com/java-read-lines-large-file) +- [Java InputStream to String](http://www.baeldung.com/convert-input-stream-to-string) +- [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) +- [Java – Write to File](http://www.baeldung.com/java-write-to-file) +- [Java - Convert File to InputStream](http://www.baeldung.com/convert-file-to-input-stream) +- [Java – Random Long, Float, Integer and Double](http://www.baeldung.com/java-generate-random-long-float-integer-double) +- [Java – Generate Random String](http://www.baeldung.com/java-random-string) +- [Java Scanner](http://www.baeldung.com/java-scanner) +- [Java Timer](http://www.baeldung.com/java-timer-and-timertask) +- [Java – Byte Array to Writer](http://www.baeldung.com/java-convert-byte-array-to-writer) +- [How to Run a Shell Command in Java](http://www.baeldung.com/run-shell-command-in-java) +- [MD5 Hashing in Java](http://www.baeldung.com/java-md5) +- [Guide to the Java ArrayList](http://www.baeldung.com/java-arraylist) +- [Guide to Java Reflection](http://www.baeldung.com/java-reflection) +- [A Guide to Java Sockets](http://www.baeldung.com/a-guide-to-java-sockets) +- [Convert char to String in Java](http://www.baeldung.com/java-convert-char-to-string) +- [Random List Element](http://www.baeldung.com/java-random-list-element) +- [Convert String to int or Integer in Java](http://www.baeldung.com/java-convert-string-to-int-or-integer) +- [Java – Directory Size](http://www.baeldung.com/java-folder-size) +- [Java – Try with Resources](http://www.baeldung.com/java-try-with-resources) +- [Guide to the Fork/Join Framework in Java](http://www.baeldung.com/java-fork-join) +- [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) +- [How to Convert String to different data types in Java](http://www.baeldung.com/java-string-conversions) +- [Introduction to Java Generics](http://www.baeldung.com/java-generics) +- [Generate equals() and hashCode() with Eclipse](http://www.baeldung.com/java-eclipse-equals-and-hashcode) +- [A Guide To Java Regular Expressions API](http://www.baeldung.com/regular-expressions-java) +- [Sorting in Java](http://www.baeldung.com/java-sorting) +- [Getting Started with Java Properties](http://www.baeldung.com/java-properties) +- [Grep in Java](http://www.baeldung.com/grep-in-java) +- [Java - Combine Multiple Collections](http://www.baeldung.com/java-combine-multiple-collections) +- [Simulated Annealing for Travelling Salesman Problem](http://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) +- [Slope One Algorithm: Collaborative Filtering Recommendation Systems](http://www.baeldung.com/java-collaborative-filtering-recommendations) +- [Differences Between the Java WatchService API and the Apache Commons IO Monitor Library](http://www.baeldung.com/java-watchservice-vs-apache-commons-io-monitor-library) +- [Pattern Search with Grep in Java](http://www.baeldung.com/grep-in-java) +- [URL Encoding and Decoding in Java](http://www.baeldung.com/java-url-encoding-decoding) +- [Calculate the Size of a File in Java](http://www.baeldung.com/java-file-size) +- [The Basics of Java Generics](http://www.baeldung.com/java-generics) +- [The Traveling Salesman Problem in Java](http://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) +- [How to Create an Executable JAR with Maven](http://www.baeldung.com/executable-jar-with-maven) +- [How to Design a Genetic Algorithm in Java](http://www.baeldung.com/java-genetic-algorithm) +- [Guide to WeakHashMap in Java](http://www.baeldung.com/java-weakhashmap) +- [Spring Security – Cache Control Headers](http://www.baeldung.com/spring-security-cache-control-headers) +- [Basic Introduction to JMX](http://www.baeldung.com/java-management-extensions) +- [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda) +- [Introduction to Nashorn](http://www.baeldung.com/java-nashorn) +- [Guide to the Guava BiMap](http://www.baeldung.com/guava-bimap) +- [Iterable to Stream in Java](http://www.baeldung.com/java-iterable-to-stream) +- [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions) +- [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) +- [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng) +- [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) +- [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency) +- [Removing all nulls from a List in Java](http://www.baeldung.com/java-remove-nulls-from-list) +- [Removing all duplicates from a List in Java](http://www.baeldung.com/java-remove-duplicates-from-list) +- [Using Math.pow in Java](http://www.baeldung.com/java-math-pow) +- [Converting Strings to Enums in Java](http://www.baeldung.com/java-string-to-enum) +- [Flattening Nested Collections in Java](http://www.baeldung.com/java-flatten-nested-collections) +- [Quick Guide to the Java StringTokenizer](http://www.baeldung.com/java-stringtokenizer) +- [JVM Log Forging](http://www.baeldung.com/jvm-log-forging) +- [Guide to sun.misc.Unsafe](http://www.baeldung.com/java-unsafe) +- [HashSet and TreeSet Comparison](http://www.baeldung.com/java-hashset-vs-treeset) +- [How to Perform a Simple HTTP Request in Java](http://www.baeldung.com/java-http-request) +- [Call Methods at Runtime Using Java Reflection](http://www.baeldung.com/java-method-reflection) +- [Guide to UUID in JAVA](http://www.baeldung.com/guide-to-uuid-in-java) +- [Comparing getPath(), getAbsolutePath(), and getCanonicalPath() in Java](http://www.baeldung.com/java-path) +- [How to Add a Single Element to a Stream](http://www.baeldung.com/java-stream-append-prepend) +- [Iterating Over Enum Values in Java](http://www.baeldung.com/java-enum-iteration) +- [Kotlin Java Interoperability](http://www.baeldung.com/kotlin-java-interoperability) +- [Using Java MappedByteBuffer](http://www.baeldung.com/java-mapped-byte-buffer) +- [How to Round a Number to N Decimal Places in Java](http://www.baeldung.com/java-round-decimal-number) +- [Changing Annotation Parameters At Runtime](http://www.baeldung.com/java-reflection-change-annotation-params) +- [How to Find all Getters Returning Null](http://www.baeldung.com/java-getters-returning-null) +- [Converting String to Stream of chars](http://www.baeldung.com/java-string-to-stream) +- [Changing the Order in a Sum Operation Can Produce Different Results?](http://www.baeldung.com/java-floating-point-sum-order) +- [How to Get a Name of a Method Being Executed?](http://www.baeldung.com/java-name-of-executing-method) +- [Iterate over a Map in Java](http://www.baeldung.com/java-iterate-map) +- [Dynamic Proxies in Java](http://www.baeldung.com/java-dynamic-proxies) +- [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy) +- [Introduction to JDBC](http://www.baeldung.com/java-jdbc) +- [Period and Duration in Java](http://www.baeldung.com/java-period-duration) +- [Converting a Stack Trace to a String in Java](http://www.baeldung.com/java-stacktrace-to-string) +- [Count Occurrences of a Char in a String](http://www.baeldung.com/java-count-chars) +- [Java Double Brace Initialization](http://www.baeldung.com/java-double-brace-initialization) +- [The StackOverflowError in Java](http://www.baeldung.com/java-stack-overflow-error) +- [Split a String in Java](http://www.baeldung.com/java-split-string) +- [Introduction to Java Serialization](http://www.baeldung.com/java-serialization) +- [How to Remove the Last Character of a String?](http://www.baeldung.com/java-remove-last-character-of-string) +- [ClassNotFoundException vs NoClassDefFoundError](http://www.baeldung.com/java-classnotfoundexception-and-noclassdeffounderror) +- [Guide to UUID in Java](http://www.baeldung.com/java-uuid) +- [Guide to Escaping Characters in Java RegExps](http://www.baeldung.com/java-regexp-escape-char) +- [Guide to hashCode() in Java](http://www.baeldung.com/java-hashcode) +- [Collect a Java Stream to an Immutable Collection](http://www.baeldung.com/java-stream-immutable-collection) +- [Difference between URL and URI](http://www.baeldung.com/java-url-vs-uri) +- [Broadcasting and Multicasting in Java](http://www.baeldung.com/java-broadcast-multicast) +- [Converting a List to String in Java](http://www.baeldung.com/java-list-to-string) +- [CharSequence vs. String in Java](http://www.baeldung.com/java-char-sequence-string) +- [Period and Duration in Java](http://www.baeldung.com/java-period-duration) +- [Guide to the Diamond Operator in Java](http://www.baeldung.com/java-diamond-operator) +- [Singletons in Java](http://www.baeldung.com/java-singleton) +- [“Sneaky Throws” in Java](http://www.baeldung.com/java-sneaky-throws) +- [OutOfMemoryError: GC Overhead Limit Exceeded](http://www.baeldung.com/java-gc-overhead-limit-exceeded) +- [How to Iterate Over a Stream With Indices](http://www.baeldung.com/java-stream-indices) +- [StringBuilder and StringBuffer in Java](http://www.baeldung.com/java-string-builder-string-buffer) +- [Number of Digits in an Integer in Java](http://www.baeldung.com/java-number-of-digits-in-int) +- [Proxy, Decorator, Adapter and Bridge Patterns](http://www.baeldung.com/java-structural-design-patterns) +- [Creating a Java Compiler Plugin](http://www.baeldung.com/java-build-compiler-plugin) +- [A Guide to the Static Keyword in Java](http://www.baeldung.com/java-static) +- [Initializing Arrays in Java](http://www.baeldung.com/java-initialize-array) +- [Guide to Java String Pool](http://www.baeldung.com/java-string-pool) +- [Copy a File with Java](http://www.baeldung.com/java-copy-file) +- [Introduction to Creational Design Patterns](http://www.baeldung.com/creational-design-patterns) + diff --git a/core-java-sun/pom.xml b/core-java-sun/pom.xml new file mode 100644 index 0000000000..3997f47d19 --- /dev/null +++ b/core-java-sun/pom.xml @@ -0,0 +1,489 @@ + + 4.0.0 + com.baeldung + core-java-sun + 0.1.0-SNAPSHOT + jar + + core-java-sun + + + + + + net.sourceforge.collections + collections-generic + ${collections-generic.version} + + + com.google.guava + guava + ${guava.version} + + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + + commons-io + commons-io + ${commons-io.version} + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + org.apache.commons + commons-math3 + ${commons-math3.version} + + + + org.decimal4j + decimal4j + ${decimal4j.version} + + + + org.bouncycastle + bcprov-jdk15on + ${bouncycastle.version} + + + + org.unix4j + unix4j-command + ${unix4j.version} + + + + com.googlecode.grep4j + grep4j + ${grep4j.version} + + + + + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + + + log4j + log4j + 1.2.17 + + + org.slf4j + slf4j-api + ${org.slf4j.version} + + + ch.qos.logback + logback-classic + ${logback.version} + + + + org.slf4j + jcl-over-slf4j + ${org.slf4j.version} + + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + + + org.hamcrest + hamcrest-all + 1.3 + test + + + + junit + junit + ${junit.version} + test + + + + org.hamcrest + hamcrest-core + ${org.hamcrest.version} + test + + + org.hamcrest + hamcrest-library + ${org.hamcrest.version} + test + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + org.mockito + mockito-core + ${mockito.version} + test + + + com.jayway.awaitility + awaitility + ${avaitility.version} + test + + + + commons-codec + commons-codec + ${commons-codec.version} + + + + org.javamoney + moneta + 1.1 + + + + org.owasp.esapi + esapi + 2.1.0.1 + + + + com.sun.messaging.mq + fscontext + ${fscontext.version} + + + com.codepoetics + protonpack + ${protonpack.version} + + + one.util + streamex + ${streamex.version} + + + io.vavr + vavr + ${vavr.version} + + + org.openjdk.jmh + jmh-core + 1.19 + + + org.openjdk.jmh + jmh-generator-annprocess + 1.19 + + + org.springframework + spring-web + 4.3.4.RELEASE + + + com.sun + tools + 1.8.0 + system + ${java.home}/../lib/tools.jar + + + + + core-java + + + src/main/resources + true + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.8 + 1.8 + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*LongRunningUnitTest.java + **/*ManualTest.java + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + prepare-package + + copy-dependencies + + + ${project.build.directory}/libs + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + libs/ + org.baeldung.executable.ExecutableMavenJar + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + package + + single + + + ${project.basedir} + + + org.baeldung.executable.ExecutableMavenJar + + + + jar-with-dependencies + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + + shade + + + true + + + org.baeldung.executable.ExecutableMavenJar + + + + + + + + + com.jolira + onejar-maven-plugin + + + + org.baeldung.executable.ExecutableMavenJar + true + ${project.build.finalName}-onejar.${project.packaging} + + + one-jar + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + spring-boot + org.baeldung.executable.ExecutableMavenJar + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + java + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + -Xmx300m + -XX:+UseParallelGC + -classpath + + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + + + + + + + + + + + integration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*ManualTest.java + + + **/*IntegrationTest.java + + + + + + + json + + + + + org.codehaus.mojo + exec-maven-plugin + + + + run-benchmarks + + none + + exec + + + test + java + + -classpath + + org.openjdk.jmh.Main + .* + + + + + + + + + + + + + 2.8.5 + + + 1.7.21 + 1.1.7 + + + 23.0 + 3.5 + 1.55 + 1.10 + 3.6.1 + 1.0.3 + 2.5 + 4.1 + 4.01 + 0.4 + 1.8.7 + 1.16.12 + 4.6-b01 + 1.13 + 0.6.5 + 0.9.0 + + + 1.3 + 4.12 + 2.8.9 + 3.6.1 + 1.7.0 + + + 3.6.0 + 2.19.1 + + \ No newline at end of file diff --git a/core-java-sun/src/main/java/com/baeldung/.gitignore b/core-java-sun/src/main/java/com/baeldung/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-sun/src/main/java/com/baeldung/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/core-java-sun/src/main/java/com/baeldung/README.md b/core-java-sun/src/main/java/com/baeldung/README.md new file mode 100644 index 0000000000..51809b2882 --- /dev/null +++ b/core-java-sun/src/main/java/com/baeldung/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [SHA-256 Hashing in Java](http://www.baeldung.com/sha-256-hashing-java) diff --git a/core-java/src/main/java/com/baeldung/javac/Positive.java b/core-java-sun/src/main/java/com/baeldung/javac/Positive.java similarity index 100% rename from core-java/src/main/java/com/baeldung/javac/Positive.java rename to core-java-sun/src/main/java/com/baeldung/javac/Positive.java diff --git a/core-java/src/main/java/com/baeldung/javac/SampleJavacPlugin.java b/core-java-sun/src/main/java/com/baeldung/javac/SampleJavacPlugin.java similarity index 100% rename from core-java/src/main/java/com/baeldung/javac/SampleJavacPlugin.java rename to core-java-sun/src/main/java/com/baeldung/javac/SampleJavacPlugin.java diff --git a/core-java-sun/src/main/resources/log4j.properties b/core-java-sun/src/main/resources/log4j.properties new file mode 100644 index 0000000000..621cf01735 --- /dev/null +++ b/core-java-sun/src/main/resources/log4j.properties @@ -0,0 +1,6 @@ +log4j.rootLogger=DEBUG, A1 + +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n \ No newline at end of file diff --git a/core-java-sun/src/main/resources/logback.xml b/core-java-sun/src/main/resources/logback.xml new file mode 100644 index 0000000000..ec0dc2469a --- /dev/null +++ b/core-java-sun/src/main/resources/logback.xml @@ -0,0 +1,19 @@ + + + + + web - %date [%thread] %-5level %logger{36} - %message%n + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/javac/SampleJavacPluginIntegrationTest.java b/core-java-sun/src/test/java/com/baeldung/javac/SampleJavacPluginIntegrationTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/javac/SampleJavacPluginIntegrationTest.java rename to core-java-sun/src/test/java/com/baeldung/javac/SampleJavacPluginIntegrationTest.java diff --git a/core-java/src/test/java/com/baeldung/javac/SimpleClassFile.java b/core-java-sun/src/test/java/com/baeldung/javac/SimpleClassFile.java similarity index 100% rename from core-java/src/test/java/com/baeldung/javac/SimpleClassFile.java rename to core-java-sun/src/test/java/com/baeldung/javac/SimpleClassFile.java diff --git a/core-java/src/test/java/com/baeldung/javac/SimpleFileManager.java b/core-java-sun/src/test/java/com/baeldung/javac/SimpleFileManager.java similarity index 100% rename from core-java/src/test/java/com/baeldung/javac/SimpleFileManager.java rename to core-java-sun/src/test/java/com/baeldung/javac/SimpleFileManager.java diff --git a/core-java/src/test/java/com/baeldung/javac/SimpleSourceFile.java b/core-java-sun/src/test/java/com/baeldung/javac/SimpleSourceFile.java similarity index 100% rename from core-java/src/test/java/com/baeldung/javac/SimpleSourceFile.java rename to core-java-sun/src/test/java/com/baeldung/javac/SimpleSourceFile.java diff --git a/core-java/src/test/java/com/baeldung/javac/TestCompiler.java b/core-java-sun/src/test/java/com/baeldung/javac/TestCompiler.java similarity index 100% rename from core-java/src/test/java/com/baeldung/javac/TestCompiler.java rename to core-java-sun/src/test/java/com/baeldung/javac/TestCompiler.java diff --git a/core-java/src/test/java/com/baeldung/javac/TestRunner.java b/core-java-sun/src/test/java/com/baeldung/javac/TestRunner.java similarity index 100% rename from core-java/src/test/java/com/baeldung/javac/TestRunner.java rename to core-java-sun/src/test/java/com/baeldung/javac/TestRunner.java diff --git a/core-java-sun/src/test/resources/.gitignore b/core-java-sun/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-sun/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/core-java/pom.xml b/core-java/pom.xml index 77000b8741..2c4cbfc37b 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -181,11 +181,6 @@ 2.1.0.1 - - com.sun.messaging.mq - fscontext - ${fscontext.version} - com.codepoetics protonpack @@ -216,13 +211,6 @@ spring-web 4.3.4.RELEASE - - com.sun - tools - 1.8.0 - system - ${java.home}/../lib/tools.jar - From 1854175cb9b0ba85685abb88bed4de6b8fdd8587 Mon Sep 17 00:00:00 2001 From: Eugen Date: Tue, 28 Nov 2017 12:39:39 +0200 Subject: [PATCH 5/5] Update README.md --- core-java-sun/README.md | 117 ---------------------------------------- 1 file changed, 117 deletions(-) diff --git a/core-java-sun/README.md b/core-java-sun/README.md index 1feee4126e..9cf8b26f1b 100644 --- a/core-java-sun/README.md +++ b/core-java-sun/README.md @@ -3,121 +3,4 @@ ## Core Java Cookbooks and Examples ### Relevant Articles: -- [Immutable ArrayList in Java](http://www.baeldung.com/java-immutable-list) -- [Java - Reading a Large File Efficiently](http://www.baeldung.com/java-read-lines-large-file) -- [Java InputStream to String](http://www.baeldung.com/convert-input-stream-to-string) -- [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) -- [Java – Write to File](http://www.baeldung.com/java-write-to-file) -- [Java - Convert File to InputStream](http://www.baeldung.com/convert-file-to-input-stream) -- [Java – Random Long, Float, Integer and Double](http://www.baeldung.com/java-generate-random-long-float-integer-double) -- [Java – Generate Random String](http://www.baeldung.com/java-random-string) -- [Java Scanner](http://www.baeldung.com/java-scanner) -- [Java Timer](http://www.baeldung.com/java-timer-and-timertask) -- [Java – Byte Array to Writer](http://www.baeldung.com/java-convert-byte-array-to-writer) -- [How to Run a Shell Command in Java](http://www.baeldung.com/run-shell-command-in-java) -- [MD5 Hashing in Java](http://www.baeldung.com/java-md5) -- [Guide to the Java ArrayList](http://www.baeldung.com/java-arraylist) -- [Guide to Java Reflection](http://www.baeldung.com/java-reflection) -- [A Guide to Java Sockets](http://www.baeldung.com/a-guide-to-java-sockets) -- [Convert char to String in Java](http://www.baeldung.com/java-convert-char-to-string) -- [Random List Element](http://www.baeldung.com/java-random-list-element) -- [Convert String to int or Integer in Java](http://www.baeldung.com/java-convert-string-to-int-or-integer) -- [Java – Directory Size](http://www.baeldung.com/java-folder-size) -- [Java – Try with Resources](http://www.baeldung.com/java-try-with-resources) -- [Guide to the Fork/Join Framework in Java](http://www.baeldung.com/java-fork-join) -- [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) -- [How to Convert String to different data types in Java](http://www.baeldung.com/java-string-conversions) -- [Introduction to Java Generics](http://www.baeldung.com/java-generics) -- [Generate equals() and hashCode() with Eclipse](http://www.baeldung.com/java-eclipse-equals-and-hashcode) -- [A Guide To Java Regular Expressions API](http://www.baeldung.com/regular-expressions-java) -- [Sorting in Java](http://www.baeldung.com/java-sorting) -- [Getting Started with Java Properties](http://www.baeldung.com/java-properties) -- [Grep in Java](http://www.baeldung.com/grep-in-java) -- [Java - Combine Multiple Collections](http://www.baeldung.com/java-combine-multiple-collections) -- [Simulated Annealing for Travelling Salesman Problem](http://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) -- [Slope One Algorithm: Collaborative Filtering Recommendation Systems](http://www.baeldung.com/java-collaborative-filtering-recommendations) -- [Differences Between the Java WatchService API and the Apache Commons IO Monitor Library](http://www.baeldung.com/java-watchservice-vs-apache-commons-io-monitor-library) -- [Pattern Search with Grep in Java](http://www.baeldung.com/grep-in-java) -- [URL Encoding and Decoding in Java](http://www.baeldung.com/java-url-encoding-decoding) -- [Calculate the Size of a File in Java](http://www.baeldung.com/java-file-size) -- [The Basics of Java Generics](http://www.baeldung.com/java-generics) -- [The Traveling Salesman Problem in Java](http://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) -- [How to Create an Executable JAR with Maven](http://www.baeldung.com/executable-jar-with-maven) -- [How to Design a Genetic Algorithm in Java](http://www.baeldung.com/java-genetic-algorithm) -- [Guide to WeakHashMap in Java](http://www.baeldung.com/java-weakhashmap) -- [Spring Security – Cache Control Headers](http://www.baeldung.com/spring-security-cache-control-headers) -- [Basic Introduction to JMX](http://www.baeldung.com/java-management-extensions) -- [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda) -- [Introduction to Nashorn](http://www.baeldung.com/java-nashorn) -- [Guide to the Guava BiMap](http://www.baeldung.com/guava-bimap) -- [Iterable to Stream in Java](http://www.baeldung.com/java-iterable-to-stream) -- [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions) -- [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) -- [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng) -- [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) -- [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency) -- [Removing all nulls from a List in Java](http://www.baeldung.com/java-remove-nulls-from-list) -- [Removing all duplicates from a List in Java](http://www.baeldung.com/java-remove-duplicates-from-list) -- [Using Math.pow in Java](http://www.baeldung.com/java-math-pow) -- [Converting Strings to Enums in Java](http://www.baeldung.com/java-string-to-enum) -- [Flattening Nested Collections in Java](http://www.baeldung.com/java-flatten-nested-collections) -- [Quick Guide to the Java StringTokenizer](http://www.baeldung.com/java-stringtokenizer) -- [JVM Log Forging](http://www.baeldung.com/jvm-log-forging) -- [Guide to sun.misc.Unsafe](http://www.baeldung.com/java-unsafe) -- [HashSet and TreeSet Comparison](http://www.baeldung.com/java-hashset-vs-treeset) -- [How to Perform a Simple HTTP Request in Java](http://www.baeldung.com/java-http-request) -- [Call Methods at Runtime Using Java Reflection](http://www.baeldung.com/java-method-reflection) -- [Guide to UUID in JAVA](http://www.baeldung.com/guide-to-uuid-in-java) -- [Comparing getPath(), getAbsolutePath(), and getCanonicalPath() in Java](http://www.baeldung.com/java-path) -- [How to Add a Single Element to a Stream](http://www.baeldung.com/java-stream-append-prepend) -- [Iterating Over Enum Values in Java](http://www.baeldung.com/java-enum-iteration) -- [Kotlin Java Interoperability](http://www.baeldung.com/kotlin-java-interoperability) -- [Using Java MappedByteBuffer](http://www.baeldung.com/java-mapped-byte-buffer) -- [How to Round a Number to N Decimal Places in Java](http://www.baeldung.com/java-round-decimal-number) -- [Changing Annotation Parameters At Runtime](http://www.baeldung.com/java-reflection-change-annotation-params) -- [How to Find all Getters Returning Null](http://www.baeldung.com/java-getters-returning-null) -- [Converting String to Stream of chars](http://www.baeldung.com/java-string-to-stream) -- [Changing the Order in a Sum Operation Can Produce Different Results?](http://www.baeldung.com/java-floating-point-sum-order) -- [How to Get a Name of a Method Being Executed?](http://www.baeldung.com/java-name-of-executing-method) -- [Iterate over a Map in Java](http://www.baeldung.com/java-iterate-map) -- [Dynamic Proxies in Java](http://www.baeldung.com/java-dynamic-proxies) -- [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy) -- [Introduction to JDBC](http://www.baeldung.com/java-jdbc) -- [Period and Duration in Java](http://www.baeldung.com/java-period-duration) -- [Converting a Stack Trace to a String in Java](http://www.baeldung.com/java-stacktrace-to-string) -- [Count Occurrences of a Char in a String](http://www.baeldung.com/java-count-chars) -- [Java Double Brace Initialization](http://www.baeldung.com/java-double-brace-initialization) -- [The StackOverflowError in Java](http://www.baeldung.com/java-stack-overflow-error) -- [Split a String in Java](http://www.baeldung.com/java-split-string) -- [Introduction to Java Serialization](http://www.baeldung.com/java-serialization) -- [How to Remove the Last Character of a String?](http://www.baeldung.com/java-remove-last-character-of-string) -- [ClassNotFoundException vs NoClassDefFoundError](http://www.baeldung.com/java-classnotfoundexception-and-noclassdeffounderror) -- [Guide to UUID in Java](http://www.baeldung.com/java-uuid) -- [Guide to Escaping Characters in Java RegExps](http://www.baeldung.com/java-regexp-escape-char) -- [Guide to hashCode() in Java](http://www.baeldung.com/java-hashcode) -- [Collect a Java Stream to an Immutable Collection](http://www.baeldung.com/java-stream-immutable-collection) -- [Difference between URL and URI](http://www.baeldung.com/java-url-vs-uri) -- [Broadcasting and Multicasting in Java](http://www.baeldung.com/java-broadcast-multicast) -- [Converting a List to String in Java](http://www.baeldung.com/java-list-to-string) -- [CharSequence vs. String in Java](http://www.baeldung.com/java-char-sequence-string) -- [Period and Duration in Java](http://www.baeldung.com/java-period-duration) -- [Guide to the Diamond Operator in Java](http://www.baeldung.com/java-diamond-operator) -- [Singletons in Java](http://www.baeldung.com/java-singleton) -- [“Sneaky Throws” in Java](http://www.baeldung.com/java-sneaky-throws) -- [OutOfMemoryError: GC Overhead Limit Exceeded](http://www.baeldung.com/java-gc-overhead-limit-exceeded) -- [How to Iterate Over a Stream With Indices](http://www.baeldung.com/java-stream-indices) -- [StringBuilder and StringBuffer in Java](http://www.baeldung.com/java-string-builder-string-buffer) -- [Number of Digits in an Integer in Java](http://www.baeldung.com/java-number-of-digits-in-int) -- [Proxy, Decorator, Adapter and Bridge Patterns](http://www.baeldung.com/java-structural-design-patterns) - [Creating a Java Compiler Plugin](http://www.baeldung.com/java-build-compiler-plugin) -- [A Guide to the Static Keyword in Java](http://www.baeldung.com/java-static) -- [Initializing Arrays in Java](http://www.baeldung.com/java-initialize-array) -- [Guide to Java String Pool](http://www.baeldung.com/java-string-pool) -- [Copy a File with Java](http://www.baeldung.com/java-copy-file) -- [Introduction to Creational Design Patterns](http://www.baeldung.com/creational-design-patterns) -