Checking if an Array Is Null or Empty in Java
1. Overview In Java, manipulating arrays is a common task, which often involves checking if an array is null or empty. This is crucial for preventing NullPointerExceptions and ensuring our code behaves...
View ArticleFix ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer
1. Overview Java is renowned for its robustness and versatility as a programming language, yet it also presents its fair share of challenges, much like any other language. One prevalent issue that...
View ArticleIntro to SpotBugs
1. Overview Identifying bugs in Java programs is a critical challenge in software development. SpotBugs is an open-source static analysis tool used to find bugs in Java code. It operates on Java...
View ArticleFixing Spring Boot H2 Exception: “Schema not found”
1. Overview H2 is an open-source SQL database often used for testing purposes in the Java community. Its in-memory nature doesn’t persist anything to the disk and that makes it very fast. We may...
View ArticleReducing Duplication With Spock’s Helper Methods
1. Introduction When writing tests we often assert comparisons on various attributes of an object. Spock has some useful language features that help us eliminate duplication when we compare objects. In...
View ArticleCounting Subrrays Having a Specific Arithmetic Mean in Java
1. Overview In this short tutorial, we’ll learn how to efficiently find the number of contiguous subarrays of an array with a given arithmetic mean. We’ll start with a naive approach that computes the...
View ArticleGetting Month Number From Its Name in Java
1. Overview When working with months in Java, we often leverage the numerical format because it helps standardize across different languages and regions as month names vary widely. In this short...
View ArticleJava Weekly, Issue 551
1. Spring and Java >> Structured Concurrency is More Than ShutdownOnFailure [foojay.io] Going beyond shutdown on failure: throttling, circuit breaking, list conversion, default values, and...
View ArticleParse JSON with Manifold
1. Introduction In this article, we’re going to look at Manifold JSON for JSON Schema-aware parsing of JSON documents. We’ll see what it is, what we can do with it, and how to use it. Manifold is a...
View ArticleIgnoring Fields During Comparison Using AssertJ
1. Introduction Ignoring fields during comparison with AssertJ is a powerful feature that helps to simplify tests by focusing only on the relevant parts of the objects. It’s beneficial when dealing...
View ArticleGet Date and Time From a Datetime String in Java
1. Introduction Working with date and time is a common task in many Java applications. Whether for parsing input, formatting output, or manipulating dates and times within the program, Java provides...
View ArticleWhy the Order of Maven Dependencies Is Important
1. Introduction Maven is one of the most popular build and dependency management tools in the Java ecosystem. While it provides a convenient way to declare and use different frameworks and libraries in...
View ArticleHow to Send a Post Request in Camel
1. Overview Apache Camel is a robust open-source integration framework. It provides a mature set of components to interact with various protocols and systems, including HTTP. In this tutorial, we’ll...
View ArticleMultiple Criteria in Spring Data Mongo DB Query
1. Introduction In this tutorial, we’ll explore how to create queries with multiple criteria in MongoDB using Spring Data JPA. 2. Setting up the Project To start, we need to include the necessary...
View ArticleHow to Convert String to StringBuilder and Vice Versa in Java
1. Overview Working with Strings is a fundamental aspect of Java programming. StringBuilder is an often-used utility for String manipulations, such as concatenation, reversing, etc. Understanding how...
View ArticleSending WhatsApp Messages in Spring Boot Using Twilio
1. Overview WhatsApp Messenger is the leading messaging platform in the world, making it an essential tool for businesses to connect with their users. By communicating over WhatsApp, we can enhance...
View ArticleConnect with PostgreSQL Database over SSL
1. Introduction In the world of database management, ensuring secure communication between applications and databases is important. In this tutorial, we’ll look at how to connect to PostgreSQL over SSL...
View ArticleSoft Assertions with AssertJ
1. Introduction In this tutorial, we’ll examine AssertJ‘s soft assertions feature, review its motivation, and discuss similar solutions in other testing frameworks. 2. The Motivation First, we should...
View ArticleSort JSON Objects in Java
1. Overview JSON is a widely employed structured data format typically used in most modern APIs and data services. It’s particularly popular in web applications due to its lightweight nature and...
View Article