Java8

Unit testing void methods with Mockito and JUnit

Reading Time: 3 minutes Writing functionality is the main focus whenever we are writing a software program, but it is equally important that we make sure our code works the way we intended it to. And how do we do that? By writing unit test cases. They are used to test the smallest functionality of code. Unit test cases are an essential part of software development. In this blog, Continue Reading

Introduction to MongoDB with Java

Reading Time: 3 minutes We now live in a data driven world where we are generating so much data that it becomes difficult to manage this data using databases. There are different databases available for different use cases. For a long time Relational databases were used for most of the uses cases, but as the technology advanced and modern applications came which need more scalability and variety came into Continue Reading

Why to use Java9 when I have Java8?

Reading Time: 3 minutes The concept of JPMS i.e. Java Platform Module System came in Java 9. Its development was first started in 2005 and finally in 2017, this concept came under the project named Jigsaw. Until Java 8, we used jar files for packaging and bundling the application, but from Java 9 onward, we will be using modules for that. Modularity is the basic rule of good software Continue Reading

The Concept of Date and Time in Java-8

Reading Time: 3 minutes Hi guys, Let’s discuss the concept of Date and Time in Java 8. Well, it was already there then why again in java 8? That is because previously we have many issues in working. So, there are many improvements in java 8 which we will see here. Advantages over old Date-Time API First, we see how the new API is better than the older one: Continue Reading

Functional Java: Powerful Feature of Java8 – Lambda Expression

Reading Time: 2 minutes As we know that java8 has come up with a lot of new features Lambda Expression is one of them. It will help us in many ways like reduce the boilerplate code and make our code look clean and concise. Lambda Expression A Lambda expression is an anonymous function and is expressed as an instance of functional interfaces. Why we need Lambda Expression and how Continue Reading

Different ways of Handling Exceptions in CompletableFutures

Reading Time: 3 minutes Hi Folks! As part of this blog, we will explore how we can handle exception in the different computing stages when we use CompletableFuture. We assume the read has the basic idea of the CompletableFuture. Nonethless, will start with the basic introduction of the CompletableFuture. What is CompletableFuture A CompletableFuture is used for asynchronous programming which was introduced as an improvement of the java Future API in Continue Reading

Merge Lists of Map to Map, Java 8 Style!

Reading Time: 3 minutes Today, while doing my work and having fun programming, I came across a problem that looked pretty easy in the beginning, but after starting doing it, had to take help of Google and read from different sites to get to a nice implementation. So, let’s look at the problem and how to solve it. The Problem Well, you guys probably already have guessed what the Continue Reading

Java concurrency: Reentrant Locks

Reading Time: 3 minutes Hello readers! Welcome to another blog in the Java concurrency series. Today, we are going to look at the Reentrant Locks in Java. What it is, how to use it, and mainly, what is the difference between using Reentrant Locks and synchronization. So, let’s dive straight into it. Reentrant Locks Reentrant locks work just like the synchronized locks in java, but have much more facilities Continue Reading