JUnit Custom Display Name Generator API 1. Overview JUnit 5 has good support for customizing test class and test method names. In this quick tutorial, we’ll see how we can use JUnit 5 custom display name generators via the @DisplayNameGeneration annotation. 2. Display Name Generation We can configure custom display… Continue Reading junit-custom-display-name-generator

3 Common Hibernate Performance Issues and How to Find Them in Your Log File Logging Persistence Hibernate 1. Introduction You’ve probably read some of the complaints about bad Hibernate performance or maybe you’ve struggled with some of them yourself. I have been using Hibernate for more than 15 years now… Continue Reading hibernate-common-performance-problems-in-logs

Changing Annotation Parameters At Runtime 1. Overview Annotations, a form of metadata which you can add to Java code. These annotations can be processed at compile time and embedded to class files or can be retained and accessed at runtime using Reflection. In this article, we will discuss how to… Continue Reading java-reflection-change-annotation-params

Using Lombok’s @Getter for Boolean Fields 1. Introduction Project Lombok is a popular library for reducing Java boilerplate. In this quick tutorial, we’ll take a look at how Lombok’s @Getter annotation works on boolean fields to remove the need to create its corresponding getter methods. 2. Maven Dependency Let’s start by adding… Continue Reading lombok-getter-boolean

Checked and Unchecked Exceptions in Java 1. Overview Java exceptions fall into two main categories: checked exceptions and unchecked exceptions. In this article, we’ll provide some code samples on how to use them. 2. Checked Exceptions In general, checked exceptions represent errors outside the control of the program. For example,… Continue Reading java-checked-unchecked-exceptions

Java Generics Interview Questions (+Answers) 1. Introduction In this article, we’ll go through some example Java generics interview questions and answers. Generics are a core concept in Java, first introduced in Java 5. Because of this, nearly all Java codebases will make use of them, almost guaranteeing that a developer… Continue Reading java-generics-interview-questions