How to Find all Getters Returning Null
1. Overview In this quick article, we’ll use the Java 8 Stream API and the Introspector class – to invoke all getters found in a POJO. We will create a stream of getters, inspect return values and see...
View ArticleHow to Get All Spring-Managed Beans?
1. Overview In this article, we’ll explore different techniques for displaying all Spring-managed beans withing the container. 2. The IoC Container A bean is the foundation of a Spring-managed...
View ArticleJava Web Weekly, Issue 181
Lots of interesting writeups on Java 9 this week. Here we go… 1. Spring and Java >> Cleaner Parameterized Tests With JUnit 5 [blog.codeleak.pl] JUnit 5 brings many new exciting features – one of...
View ArticleIntroduction to Liquibase Rollback
1. Overview In our previous article, we showed Liquibase as a tool for managing database schemas and data. In this article, we’re going to look more into the rollback feature – and how we can undo a...
View ArticleConverting String to Stream of chars
1. Overview Java 8 introduced the Stream API, with functional-like operations for processing sequences. If you want to read more about it, have a look at this article. In this quick article, we’ll see...
View ArticleChanging the Order in a Sum Operation Can Produce Different Results?
1. Overview In this quick article, we’re going to have a look at why changing the sum order returns a different result. 2. Problem When we look at the following code, we can easily predict the correct...
View ArticleIntroduction to Quartz
1. Overview Quartz is an open source job-scheduling framework written entirely in Java and designed for use in both J2SE and J2EE applications. It offers great flexibility without sacrificing...
View ArticleTesting with Selenium/WebDriver and the Page Object Pattern
1. Introduction In this article, we’re going to build on the previous writeup and continue to improve our Selenium/WebDriver testing by introducing the Page Object pattern. 2. Adding Selenium Let’s...
View ArticleLocality-Sensitive Hashing in Java Using Java-LSH
1. Overview The Locality-Sensitive Hashing (LSH) algorithm hashes input items so that similar items have a high probability of being mapped to the same buckets. In this quick article, we will use the...
View ArticleDrools Using Rules from Excel Files
1. Overview Drools has support for managing business rules in a spreadsheet format. In this article, we’ll see a quick example of using Drools to manage business rules using an Excel file. 2. Maven...
View ArticleExploring the Spring 5 MVC URL Matching Improvements
1. Overview Spring 5 will bring a new PathPatternParser for parsing URI template patterns. This is an alternative to the previously used AntPathMatcher. The AntPathMatcher was an implementation of...
View ArticleVert.x Spring Integration
1. Overview In this quick article, we’ll discuss the integration of Spring with Vert-x and leverage the best of both worlds: the powerful and well-known Spring feature, and the reactive single-event...
View ArticleHow to Get a Name of a Method Being Executed?
1. Overview Sometimes we need to know the name of the current Java method being executed. This quick article presents a couple of simple ways of getting hold of the method name in the current...
View ArticleSpring YAML Configuration
1. Overview One of the ways of configuring Spring applications is using YAML configuration files. In this quick article, we’ll configure different profiles for a simple Spring Boot application using...
View ArticleJava Weekly, Issue 182
Lots of interesting writeups on Java 9 this week. Here we go… 1. Spring and Java >> Kotlin and Spring: Working with JPA and data classes [codecentric.de] Kotlin makes it possible to create...
View ArticleAllow Authentication from Accepted Locations Only with Spring Security
1. Overview In this tutorial, we’ll focus on a very interesting security feature – securing the account of a user based on their location. Simply put, we’ll block any login from unusual or...
View ArticleHow to Warm Up the JVM
1. Overview The JVM is one of the oldest yet powerful virtual machines ever built. In this article, we have a quick look at what it means to warm up a JVM and how to do it. 2. JVM Architecture Basics...
View ArticleIterate over a Map in Java
1. Overview In this quick article, we’ll have a look at the different ways of iterating through the entries of a Map in Java. Simply put, we can extract the contents of a Map using keySet(),...
View ArticleMonte Carlo Tree Search for Tic-Tac-Toe Game
1. Overview In this article, we’re going to explore the Monte Carlo Tree Search (MCTS) algorithm and its applications. We’ll look at its phases in detail by implementing the game of Tic-Tac-Toe in...
View ArticleSpring with Maven BOM
1. Overview In this quick tutorial, we’re going to look at how Maven, a tool based on the concept of Project Object Model (POM), can make use of a BOM or “Bill Of Materials”. For more details about...
View Article