Pass Collection as Varargs Argument
1. Overview In this tutorial, we’ll explore different approaches to supply a Collection as an argument for a varargs parameter. 2. What’s a Varargs Parameter? Variable arguments, or varargs for short,...
View ArticleHow to use virtual threads with ScheduledExecutorService
1. Introduction Virtual threads are a useful feature officially introduced in JDK 21 as a solution to improve the performance of high-throughput applications. However, the JDK has no built-in...
View ArticleFind by Property of a Nested Object in Spring Data
1. Overview In Spring Data, it’s common to query entities using derived queries based on method names. When dealing with relationships between entities, such as nested objects, Spring Data provides...
View ArticleFilter a List by Nested Lists in Java
1. Introduction In this tutorial, we’ll explore how to filter a list that contains nested lists in Java. When working with complex data structures, such as lists of objects that contain other lists, it...
View ArticleJava Date and Calendar: From Legacy to Modern Approaches
1. Overview Handling date and time is a fundamental part of many Java applications. Over the years, Java has evolved in dealing with dates, introducing better solutions to simplify things for...
View ArticleConsuming Messages in Batch in Kafka Using @KafkaListener
1. Overview In this tutorial, we’ll discuss handling Kafka messages in batches with Spring Kafka library’s @KafkaListener annotation. Kafka broker is a middleware that helps persist messages from...
View ArticleIntroduction to JetBrains Xodus
1. Overview Xodus is an open-source embedded database built by JetBrains. We can use it as an alternative to relational databases. Using Xodus we obtain a high-performance transactional key-value store...
View ArticleJava Weekly, Issue 567
1. Spring and Java >> Exploring New Features in JDK 23: Module Design Pattern with JEP-476 [foojay.io] JDK 23 brings module imports as a preview feature, intending to simplify the import of...
View ArticleIntroduction to JavaMelody
1. Introduction As application developers, we generally build complex business logic as efficiently as possible. However, once these applications are in production, we would also like to gather runtime...
View ArticleConnect to Oracle Database with JDBC Driver
1. Overview The Oracle Database is one of the most popular relational databases. In this tutorial, we’ll learn how to connect to an Oracle Database using a JDBC Driver. 2. The Database To get us...
View ArticleMockito Answer API: Returning Values Based on Parameters
1. Introduction Mocking is a testing technique that replaces real components with objects that have predefined behavior. This allows developers to isolate and test specific components without relying...
View ArticleIntroduction to Lanterna
1. Introduction Lanterna is a library for building text-based user interfaces, giving us similar abilities to the Curses C library. However, Lanterna is written in pure Java. It also gives us the...
View Article