Difference Between isA() and anyObject() in EasyMock
1. Introduction When writing unit tests with EasyMock, we often need to verify that the methods are called with specific types of arguments. EasyMock provides two main matching methods for this...
View ArticleUsing Greater-Than-Or-Equal-to in a Switch Statement in Java
1. Overview switch statements are commonly used to simplify complex if-else chains. They provide a way to perform different actions based on a single variable’s value. However, a switch statement in...
View ArticleResolving ClassCastException: Ljava.lang.Object; cannot be cast to...
1. Overview In Java, arrays are a fundamental part of the language, providing a structured way to store multiple values of the same type. However, when working with arrays and type casting, we...
View ArticleJava Weekly, Issue 581
1. Spring and Java >> Micronaut Framework 4.7.0 Provides Integration with LangChain4j and Graal Languages [infoq.com] The recent version of the Micronaut framework provides support for...
View ArticleBuilding and Running a Micronaut Application in a Docker Container
1. Introduction In this tutorial, we’ll explore how to build and run a Micronaut application in a Docker container. We’ll discuss everything from setting up a Micronaut project to creating and running...
View ArticleHow to Execute Multiple SQL Statements as One in JDBC
1. Overview When working with a database using Java and JDBC, there are scenarios where we need to execute multiple SQL statements as a single operation. It can help us improve the application...
View ArticleCreate Kafka Consumers With Reactor Kafka
1. Introduction Apache Kafka is a popular distributed event streaming platform, and when combined with Project Reactor, it enables building resilient and reactive applications. Reactor Kafka is a...
View ArticleHow to Distinguish Between Field Absent vs. Null in Jackson
1. Introduction In this tutorial, we’ll explore ways to configure Jackson’s ObjectMapper to handle serialization and deserialization for null and absent values. Finally, we’ll demonstrate a real-world...
View ArticleSorting Alphanumeric Strings in Java
1. Introduction Sorting alphanumeric strings is a common task in Java when dealing with mixed sequences of numbers and letters. This is particularly useful in file sorting, database indexing, and UI...
View ArticleHow to Connect Kafka with ElasticSearch
1. Overview In this tutorial, we’ll learn how to connect Apache Kafka to ElasticSearch using the Kafka Connector Sink. The Kafka project provides Kafka Connect, a powerful tool that allows seamless...
View ArticleIntroduction to ActiveJ
1. Overview ActiveJ is a lightweight Java framework for high-performance applications. We can use it to create minimalistic and modular applications with a fast startup and a small memory footprint. It...
View ArticleImplement SASL Authentication in Kafka With JAAS Config
1. Overview Authentication is a fundamental aspect of designing any messaging system like Kafka. We can implement authentication with approaches like user-based credentials, SSL certificates, or...
View ArticleJava Weekly, Issue 582
1. Spring and Java >> Database Migrations in the Real World [jetbrains.com] Executing database migrations is a complex process with challenges like security, downtime, or backward compatibility....
View ArticleHow to Add Partitions to an Existing Topic in Kafka
1. Overview Kafka is an extremely popular messaging queue with lots of features. We store messages inside a topic in Kafka. Topics are, in turn, divided into partitions where messages are actually...
View ArticleComposite Item Reader in Spring Batch
1. Introduction In Spring Batch, the CompositeItemReader is a tool for combining multiple ItemReader instances into a single reader. This is particularly useful when we need to read data from multiple...
View ArticleGetting Started With jMonkeyEngine
1. Introduction jMonkeyEngine is a modern, developer-friendly game engine that we can use to build games or other 3D applications in Java. In this tutorial, we’ll examine jMonkeyEngine, learning what...
View Article