1. Introduction In this article we will explore the methods that were added to List interface in and after Java 8 release. No new methods […]
How to print all Beans managed by Spring?
1. Introduction In this article we will explore how to print all spring managed beans along with their class names. 2. Content We will use […]
Complete Guide to Comparator in Apache Collections with examples.
1. Introduction Welcome to the 4th article in the Comparators series. Below are three articles that we have already discussed : Complete Guide to Comparator […]
Complete Guide to Comparators in Spring Framework with examples.
1. Introduction In the previous article we discussed Comparator interface and 17 of its methods. Before you dive into this article I would recommend reading […]
Complete Guide to Comparator in Java 8 with examples
1. Introduction The Comparator<T> interface has existed in Java from early days since version 1.2. The aim of this interface is to impose the ordering […]
Calculate the Timezone difference with UTC using Java 8
1. Introduction In this article we get the offset of the time zone to its UTC counterpart. For example : PST time zone i.e. America/Los_Angeles […]
Amazing Java 8 features you need to know Part 2
1. Introduction In a previous article we discussed several new features introduced in Java 8. 2. Content In this article we will discuss below features: […]
Amazing Java 8 features you need to know Part 1
1. Introduction Java has changed from its inception numerous times. Be it either API enhancement or compiler changes of generics type systems. We all know […]
3 wrapper families for Collections Class
1. Introduction Collections class is a static utility class which contains tons of methods which provides access to much needed functionality. This functionalities include polymorphic […]
Bridge Pattern using ApplicationContextAware.
1. Overview In this article, we will learn about building a bridge in an application that needs to be spring enabled. 2. Why develop a […]
Writing Unit Tests in Spring Boot.
1. Overview In this article, I will discuss on how to write unit tests in spring boot. Assumption here is that we are using dependency […]
Optional.orElse() vs Optional.orElseGet()
1. Introduction This article is part of ongoing series of Optional. Read about it more here. orElse(T defaultValue) method returns the value from Optional if […]
Optional orElse() family : Getting value out of Optional
1. Introduction In this article, we will look at getting value out of Optional. There are 5 methods provided in Optional class which must be […]
Introduction to Optional
1. Overview In this article, we will explore the need of Optional class that was introduced in Java 8. Prior to Java 8 there were […]
Implementing Validators in Spring using Dependency Injection.
If you want to watch the video for this blog. Click here. 1. Overview In this article I will discuss a validator pattern which will […]
Combining Optional.isPresent() and Optional.get() is an anti-pattern
1. Overview Optional is a great way to make sure whether the result is present. This article primarily discusses one anti-patterns of Optional. There are […]
Optional Class : equals, hashCode and toString methods with examples
1. Overview In this article, we will look at 3 different methods of Optional class which are overridden from Object class. As you would have […]
Collecting data from Optional using Collectors
1. Overview In this article we will convert Optional<T> to Collection. Let us first understand the use-case here. Optional can contain either 0 or 1 […]
Optional Class : filter, map and flatMap : Filtering and Transforming Optional value.
1. Overview In this article, we will look at 3 different methods of Optional class. These methods are helpful in taking an action on value, […]
Optional Class ifPresent() family : Taking action on value in Optional.
1. Overview In this article, we will look at 2 different methods of Optional class. These methods are helpful in taking an action on value, […]