Convert String XML Fragment to Document Node in Java
1. Introduction XML processing is a common requirement in Java, especially when dealing with data interchange, configuration files, or web services. Besides, converting a string that contains an XML...
View ArticleUnderstanding findAny() and anyMatch() in Streams
1. Overview In this tutorial, we’ll explore two key methods in Java 8 Streams: findAny() and anyMatch(). Both methods serve different purposes, and understanding their differences is essential for...
View ArticleUsing CompletableFuture With Feign Client in Spring Boot
1. Introduction Calling external web dependencies while maintaining low latency is a critical task when working with distributed systems. In this tutorial, we’ll use OpenFeign and CompletableFuture to...
View ArticleDifference Between Mockito Core and Mockito Inline
1. Overview Mockito is one of the most popular frameworks for creating mock objects in Java, and it offers Mockito Core and Mockito Inline as the two main libraries for unit testing with different...
View ArticleJava Weekly, Issue 560
1. Spring and Java >> JDK 23 is Released! [jdk.java.net] Java 23 is out! Including features like markdown support for docs, generational ZGC, more enhanced switch, module imports, and a lot more...
View ArticleHow Does a Random Seed Work in Java?
1. Overview Randomness is a fascinating concept with applications in various fields such as cryptography, gaming, simulations, and machine learning. In computer systems, true randomness is elusive. In...
View ArticleHow to Convert String to Date Using MapStruct in Java?
1. Introduction MapStruct is a powerful library in Java that simplifies the process of mapping between different object models at compile time. It uses annotations to automatically generate type-safe...
View ArticleError Handling in Micronaut
1. Overview Error handling is one of the main concerns when developing systems. On a code level, error handling handles exceptions thrown by the code we write. On a service level, by errors, we mean...
View ArticleWhy Is 2 * (i * i) Faster Than 2 * i * i in Java?
1. Overview When optimizing code, even small differences in expression syntax can impact performance. One such example is the difference between 2 * (i * i) and 2 * i * i in Java. At first glance,...
View ArticleProcessing JDBC ResultSet With Stream API
1. Overview Iterating through the ResultSet is a common approach to retrieving data from a JDBC query. However, in some cases, we may prefer to work with a stream of records instead. In this article,...
View ArticleCalling getClass() From a Static Context
1. Overview In Java, understanding how we call methods in static and non-static contexts is crucial, especially when working with methods like getClass(). One common problem we might encounter is...
View ArticleImplicitly Declared Classes and Instance Main Methods in Java
1. Overview In recent versions of Java, the Oracle team has been focusing on making the Java language more accessible for newbie programmers. As part of that, the Oracle team has introduced implicit...
View ArticleBuilding a RAG App Using MongoDB and Spring AI
1. Overview The use of AI technologies is becoming a key skill in modern development. In this article, we’ll build a RAG Wiki application that can answer questions based on stored documents. We’ll use...
View ArticleIntroduction to the Hilla Framework
1. Overview Hilla is a full-stack web framework for Java. Hilla lets us build a full-stack application by adding React views to a Spring Boot application and calling backend Java services from...
View ArticleLeveraging Quarkus and LangChain4j
1. Overview In this tutorial, we’ll learn about LangChain, a framework for developing applications powered by large language models (LLMs). More specifically, we’ll use langchain4j, a Java framework...
View ArticleIntroduction to TeaVM
1. Overview TeaVM is a powerful tool for translating Java bytecode into JavaScript, enabling Java applications to run directly in the browser. This allows us to maintain a Java-based codebase while...
View ArticleCreate Avro Schema With List of Objects
1. Overview Apache Avro is a data serialization framework that provides powerful data structures and a lightweight, fast, binary data format. In this tutorial, we’ll explore how to create an Avro...
View ArticleJava Weekly, Issue 561
1. Spring and Java >> A beginner’s guide to Spring Data Envers [vladmihalcea.com] Auditing made easy: tracking entity changes with almost no changes required on the application part with Spring...
View ArticleWhat’s the Difference Between interface and @interface in Java?
1. Overview Let’s dive deep to see what interface and @interface are and their applications. An interface is a contract for a class that implements it. In the most common form, it is a group of related...
View ArticleIterate over a Guava Multimap
1. Overview In this article, we will look at one of Map implementations from Google Guava library – Multimap. It is a collection that maps keys to values, similar to java.util.Map, but in which each...
View Article