Guide to jlink
1. Overview jlink is a tool that generates a custom Java runtime image that contains only the platform modules that are required for a given application. Such a runtime image acts exactly like the JRE...
View ArticleClosures in Groovy
1. Overview In this Introductory tutorial, we’ll explore the concept of closures in Groovy, a key feature of this dynamic and powerful JVM language. Many other languages, including Javascript and...
View ArticleFinding Elements in Collections in Groovy
1. Introduction Groovy provides a substantial number of methods enhancing Java’s core capabilities. In this tutorial, we’ll show how Groovy does this when checking for an element and finding it in...
View ArticleRead an InputStream using the Java Server Socket
1. Overview To send and receive data over a network, we often use sockets. Sockets are nothing but a combination of an IP address and a port number, which can uniquely identify a program running on any...
View ArticleSpring Data JPA – Derived Delete Methods
1. Introduction Spring Data JPA allows us to define derived methods that read, update or delete records from the database. This is very helpful as it reduces the boilerplate code from the data access...
View ArticleMap of Primitives in Java
1. Overview In this tutorial, we’ll learn how to construct a map with primitive keys and values. As we know, the core Java Maps don’t allow storage of primitive keys or values. That’s why we’ll...
View ArticleKotlin Immutable Collections
1. Introduction In this tutorial, we’ll be looking at how to create immutable collections in Kotlin. First, we’ll explore the types of immutability as well as what Kotlin provides as standard. Then,...
View ArticleJava Weekly, Issue 274
Here we go… 1. Spring and Java >> Test Execution Order in JUnit 5 [blog.codeleak.pl] An overview of the three built-in orderers, and a quick guide to writing your own custom order. Very cool....
View ArticleMockK: A Mocking Library for Kotlin
1. Overview In this tutorial, we’re going to take a look at some of the basic features of the MockK library. 2. MockK In Kotlin, all classes and methods are final. While this helps us write immutable...
View ArticleDifferences Between JAR and WAR Packaging
1. Overview In this quick tutorial, we’ll focus on the differences between JAR and WAR packaging in Java. First, we’ll define each packaging option separately. Afterwards, we’ll summarize their...
View ArticleDifference Between save() and saveAndFlush() in Spring Data JPA
1. Overview In this short tutorial, we’re going to discuss the difference between the save() and saveAndFlush() methods in Spring Data JPA. Even though both of these methods are used for saving...
View ArticleCreating New APIs and Views in JHipster
1. Introduction In this tutorial, we’ll see how we can create a new API inside a JHipster application. We’ll then integrate that API into the front-end display. 2. Sample Application For this tutorial,...
View ArticleThe Mediator Pattern in Java
1. Overview In this article, we’ll have a look at the Mediator Pattern, one of the GoF behavioral patterns. We’ll describe its purpose and explain when we should use it. As usual, we’ll also provide a...
View ArticleREST-assured Support for Spring MockMvc
1. Introduction In this tutorial, we’re going to learn how to test our Spring REST Controllers using RestAssuredMockMvc, a REST-assured API built on top of Spring’s MockMvc. First, we’ll examine the...
View ArticleThe Exists Query in Spring Data
1. Introduction In many data-centric applications, there might be situations where we need to check whether a particular object already exists. In this tutorial, we’ll discuss several ways to achieve...
View ArticleAn Introduction to Refactoring with IntelliJ IDEA
1. Overview Keeping the code tidy is not always easy. Fortunately for us, our IDEs are pretty smart nowadays and can help us in achieving this. In this tutorial, we’re going to focus on IntelliJ IDEA,...
View ArticleJava Weekly, Issue 275
Here we go… 1. Spring and Java >> A comparison of assertion libraries [blog.frankel.ch] A side-by-side comparison of Strikt and Atrium libraries for Kotlin and how they stack up against AssertJ....
View ArticleFind If Two Numbers Are Relatively Prime in Java
1. Overview Given two integers, a and b, we say that they are relatively prime if the only factor that divides both is 1. Mutually prime or coprime are synonyms for relatively prime numbers. In this...
View ArticleSLF4J Warning: Class Path Contains Multiple SLF4J Bindings
1. Overview When we use SLF4J in our applications, we sometimes see a warning message about multiple bindings in the classpath printed to the console. In this tutorial, we’ll try to understand why we...
View ArticleTypes of JPA Queries
1. Overview In this tutorial, we’ll discuss the different types of JPA queries. Moreover, we’ll focus on comparing the differences between them and expanding on each one’s pros and cons. 2. Setup...
View Article