Blog

Lists are common data structures in Java. Elements in a List have a specific order and can include duplicate elements. List have different implementations based on different use cases. The two key ones are ArrayList and LinkedList. Novice programmers often tend to use both the implementations interchangeably. However, both ArrayList and LinkedList have significant differences […]Continue reading

Timer is a utility class as a facility for Threads to schedule tasks for future execution as a background thread. You can use this class to schedule tasks for one-time execution or for repeated execution at a regular interval. In this post, I’ll explain how to schedule tasks in Java applications using the Timer and […]Continue reading

The Java collection framework provides several collection implementations to store and operate on objects. Some groups of implementations are similar in the operations they perform, and it is common for novice programmers to use them interchangeably. ArrayList and LinkedList are two such implementations that are often confused and incorrectly applied in applications. I have written […]Continue reading

I’ve previously posted about defining Consumer Driven Contracts using the OpenAPI specification and Spring Cloud Contract. This approach works well because you can tie your contracts to your API specification, and also wire in a request validator into your contract tests. But one problem that remained is typically your OpenAPI specification will span multiple services. […]Continue reading

Sorting collections is a common task that Java developers deal with on a daily bases.  The Java Collections class provides us with two sort() methods to sort all collections that implement the List interface. Sorting Primitive Types & Strings In the example below, we will create a list with ten random integers and sort the list using the sort() method, […]Continue reading

Problem You are given a string and are asked to write a method to return true if the string is a palindrome and to return false otherwise. A palindrome is a string that reads the same from front to back like alula They are many solutions to check if a string is a palindrome. I’m going […]Continue reading

The Swagger Request Validator is a slick project supported by the folks at Atlassian. Using your API definition in Swagger v2 or OpenAPI v3, it allows you to programmatically validate your API matches your API specification. The Swagger Request Validator may be used standalone, or with Spring MVC, Spring MockMVC, Spring Web Client, REST Assured, […]Continue reading