Transforming an Empty String into an Empty Optional
1. Introduction In this quick tutorial, we’ll present different ways to transform a null or empty String into an empty Optional. Getting an empty Optional out of null is straightforward — we just use...
View ArticleA Guide to jBPM with Java
1. Introduction In this tutorial, we’ll discuss the Business Process Management (BPM) System and its implementation in Java as jBPM System. 2. Business Process Management System We can define Business...
View ArticleThe Dependency Inversion Principle in Java
1. Overview The Dependency Inversion Principle (DIP) forms part of the collection of object-oriented programming principles popularly known as SOLID. At the bare bones, the DIP is a simple – yet...
View ArticleCase Insensitive Queries with Spring Data Repository
1. Overview Spring Data JPA queries, by default, are case-sensitive. In other words, the field value comparisons are case-sensitive. In this tutorial, we’ll explore how to quickly create a case...
View ArticleEnvironmentPostProcessor in Spring Boot
1. Overview As of Spring Boot 1.3, we’re able to use the EnvironmentPostProcessor to customize the application’s Environment before application context is refreshed. In this tutorial, let’s take a look...
View ArticleHow to Read HTTP Headers in Spring REST Controllers
1. Introduction In this quick tutorial, we’re going to look at how to access HTTP Headers in a Spring Rest Controller. First, we’ll be using the @RequestHeader annotation to read headers individually...
View ArticleCannot Reference “X” Before Supertype Constructor Has Been Called
1. Overview In this short tutorial, we’ll show how we can get the error Cannot reference “X” before supertype constructor has been called, and how to avoid it. 2. Constructors Chain A constructor can...
View ArticleAvoid Check for Null Statement in Java
1. Overview Generally, null variables, references, and collections are tricky to handle in Java code. Not only are they hard to identify, but they’re also complex to deal with. As a matter of fact, any...
View ArticleBIRT Reporting with Spring Boot
1. Introduction In this tutorial, we’re going to integrate BIRT (Business Intelligence and Reporting Tools) with Spring Boot MVC, to serve static and dynamic reports in HTML and PDF format. 2. What is...
View ArticleReversing a Binary Tree in Java
1. Overview Reversing a binary tree is one of the problems that we might be asked to solve during a technical interview. In this quick tutorial, we’ll see a couple of different ways of solving this...
View ArticleSpring Cloud Data Flow With Apache Spark
1. Introduction Spring Cloud Data Flow is a toolkit for building data integration and real-time data processing pipelines. Pipelines, in this case, are Spring Boot applications that are built with...
View ArticleREST vs WebSockets
1. Overview In this tutorial, we’ll go through the basics of client-server communication and explore this through two popular options available today. We’ll see how WebSocket, which is a new entrant,...
View ArticleJava Weekly, Issue 276
Here we go… 1. Spring and Java >> Running Kotlin Tests With Maven [petrikainulainen.net] A useful, extensive walkthrough using Kotlin with Maven intelligently. Practical and to the point....
View ArticleCompressed OOPs in the JVM
1. Overview The JVM manages memory for us. This removes the memory management burden from the developers, so we don’t need to manipulate object pointers manually, which is proven to be time consuming...
View ArticleGuide to Spring Cloud Kubernetes
1. Overview When we build a microservices solution, both Spring Cloud and Kubernetes are optimal solutions, as they provide components for resolving the most common challenges. However, if we decide to...
View ArticleCopying a HashMap in Java
1. Overview In this tutorial, we’ll explore the concept of a shallow vs deep copy of a HashMap along with several techniques to copy a HashMap in Java. We’ll also consider some of the external...
View ArticleA Quick Guide To Using Cloud Foundry UAA
1. Overview Cloud Foundry User Account and Authentication (CF UAA) is an identity management and authorization service. More precisely, it’s an OAuth 2.0 provider allowing authentication and issuing...
View ArticleWhy Do Local Variables Used in Lambdas Have to Be Final or Effectively Final?
1. Introduction Java 8 gives us lambdas, and by association, the notion of effectively final variables. Ever wondered why local variables captured in lambdas have to be final or effectively final?...
View ArticleSpring Security Kerberos Integration
1. Overview In this tutorial, we’ll provide an overview of Spring Security Kerberos. We’ll write a Kerberos client in Java that authorizes itself to access our Kerberized service. And we’ll run our own...
View ArticleGuide to Spock Extensions
1. Overview In this tutorial, we’ll take a look at Spock extensions. Sometimes, we might need to modify or enhance our spec’s lifecycle. For example, we’d like to add some conditional execution, retry...
View Article