The SpringJUnitConfig and SpringJUnitWebConfig Annotations in Spring 5 1. Introduction In this quick article, we’ll take a look at the new @SpringJUnitConfig and @SpringJUnitWebConfig annotations available in Spring 5. These annotations are a composition of JUnit 5 and Spring 5 annotations that make test creation easier and faster. 2. @SpringJUnitConfig… Continue Reading spring-5-junit-config

Differences Between the Java WatchService API and the Apache Commons IO Monitor Library 1. Overview Long before the Java WatchService API was released in Java 7, Apache Commons IO Monitoring library was already addressing the same use-case of monitoring a file system location or directory for changes. In this article,… Continue Reading java-watchservice-vs-apache-commons-io-monitor-library

Native Memory Tracking in JVM 1. Overview Ever wondered why Java applications consume much more memory than the specified amount via the well-known -Xms and -Xmx tuning flags? For a variety of reasons and possible optimizations, the JVM may allocate extra native memory. These extra allocations can eventually raise the consumed… Continue Reading native-memory-tracking-in-jvm

Collections.emptyList() vs. New List Instance 1. Introduction In this short tutorial, we’ll illustrate the difference between Collections.emptyList() and a new list instance. 2. Immutability The core difference between java.util.Collections.emptyList() and a new list e.g. new ArrayList<>() is immutability. Collections.emptyList() returns a list (java.util.Collections.EmptyList) that can’t be modified. When creating a… Continue Reading java-collections-emptylist-new-list

Default Password Encoder in Spring Security 5 1. Overview In Spring Security 4, it was possible to store passwords in plain text using in-memory authentication. A major overhaul of the password management process in version 5 has introduced more secure default mechanism for encoding and decoding passwords. This means that… Continue Reading spring-security-5-default-password-encoder