Lookahead and Lookbehind in Java Regex
1. Overview Sometimes we might face difficulty matching a string with a regular expression. For example, we might not know what we want to match exactly, but we can be aware of its surroundings, like...
View ArticleDifference Between Maven Surefire and Failsafe Plugins
1. Overview In typical Test Driven Development, we aim to write lots of low-level unit tests that are fast to run and set up in isolation. Additionally, there are also few high-level integration tests...
View ArticleKubernetes Deployment vs. StatefulSets
1. Overview Kubernetes (K8s) is an open-source container orchestration system. It allows us to automate deployments, scale, and manage containerized applications. In this tutorial, we'll discuss two...
View ArticleSwagger @Api Description Is Deprecated
1. Overview Describing a RESTful API plays an important role in the documentation. One common tool used to document REST APIs is Swagger 2. However, one useful attribute used for adding a description...
View ArticleJPA Entities and the Serializable Interface
1. Introduction In this tutorial, we'll discuss how JPA entities and the Java Serializable interface blend. First, we'll take a look at the java.io.Serializable interface and why we need it. After...
View ArticleDifferent Serialization Approaches for Java
1. Overview Serialization is the process of converting an object into a stream of bytes. That object can then be saved to a database or transferred over a network. The opposite operation, extracting an...
View Article“Code too large” Compilation Error in Java
1. Overview When a Java method exceeds 65535 bytes, we get the compilation error, “code too large”. In this article, we'll discuss why this error occurs and how to fix it. 2. JVM Constraints The...
View ArticleConverting Camel Case and Title Case to Words in Java
1. Overview Strings commonly contain a mixture of words and other delimiters. Sometimes, these strings may delimit words by a change in case without whitespace. For example, camel case capitalizes each...
View ArticleStart Two Threads at the Exact Same Time in Java
1. Overview Multi-thread programming allows us to run threads concurrently, and each thread can handle different tasks. Thus, it makes optimal use of the resources, particularly when our computer has a...
View ArticleSend Large Messages With Kafka
1. Overview Apache Kafka is a powerful, open-source, distributed, fault-tolerant event streaming platform. However, when we use Kafka to send messages larger than the configured size limit, it gives an...
View ArticleThe java.lang.NoClassDefFoundError in JUnit
1. Overview In this article, we'll understand why the java.lang.NoClassDefFoundError occurs in JUnit and how to fix it. This issue is mainly related to IDE's configurations. Therefore, we'll be...
View ArticleCount Occurrences Using Java groupingBy Collector
1. Overview In this short tutorial, we'll see how we can group equal objects and count their occurrences in Java. We'll use the groupingBy() collector in Java. 2. Count Occurrences using...
View ArticleJava Weekly, Issue 393
1. Spring and Java >> Quarkus 2.0.0.Final released [quarkus.io] Lots of new and exciting features in Quarkus 2.0 – continuous testing, brand new CLI, more Kotlin friendly, more extensions, and so...
View ArticleFind the GC Algorithm Used by a JVM Instance
1. Overview In addition to typical development utilities such as compiler and runtime, each JDK release is shipped with a myriad of other tools. Some of these tools can help us to gain valuable...
View ArticleList Active Brokers in a Kafka Cluster Using Shell Commands
1. Overview Monitoring an event-driven system that uses the Apache Kafka cluster would often require us to get the list of active brokers. In this tutorial, we'll explore few shell commands to get the...
View ArticleConverting String to BigInteger in Java
1. Overview In this tutorial, we'll demonstrate how we can convert a String to a BigInteger. The BigInteger is commonly used for working with very large numerical values, which are usually the result...
View ArticleTiered Compilation in JVM
1. Overview The JVM interprets and executes bytecode at runtime. In addition, it makes use of the just-in-time (JIT) compilation to boost performance. In earlier versions of Java, we had to manually...
View ArticleAdditional Source Directories in Maven
1. Overview In this tutorial, we'll explain how we can add multiple source directories in the Maven-based Java project. 2. Extra Source Directory Let's assume we need to add a /newsrc source directory...
View ArticleStatic Classes Versus the Singleton Pattern in Java
1. Introduction In this quick tutorial, we'll discuss some eminent differences between programming to the Singleton design pattern and using static classes in Java. We'll review both the coding...
View ArticleForce Repository Update with Maven
1. Overview In this tutorial, we'll learn how to force-update a local Maven repository when it becomes corrupted. To accomplish this, we'll use a straightforward example to understand why a repository...
View Article