Junit Code Coverage using Gradle, Jacoco

For your Java application you need to check the code coverage of your Junit test classes. Code coverage ensures your code quality for the Junit test cases you have written for your functionalities of the application. Here I am going to show you how you can use Jacoco plugin to test the coverage. Currently it supports instruction, branch, line, method…

Creating new Gradle Project in IntelliJ IDEA

In this tutorial I will show you how to create Java Gradle project in IntelliJ IDEA. If you have not installed already IntelliJ IDEA then you can download and install it from the below link https://www.jetbrains.com/idea/download/

Java 8 onward Default and Static Methods Example

Introduction In this tutorial I am going to show how default and static methods can be included into Java 8 interfaces. Prior to Java 8 you did not have such mechanism to include default method or static method into interface but Java 8 provides such option to include those methods. Prior to Java 8 if a new methods was added…

Java Enum Example

This tutorial will show how to use Enum in Java. It will show how to get enum instances code by name.

Custom Jackson Joda DateTime Deserializer

This tutorial shows how to deserialize date format when unmarshaling JSON using Jackson. The custom annotation will be created in order to pass the date format using annotation.

Custom Jackson Joda DateTime Serializer

This tutorial shows how to serialize date format when marshaling JSON using Jackson. The custom annotation will be created in order to pass the date format using annotation.

How to create Custom Thread Pool in Java

Introduction In this tutorial I am going to show how to create custom thread pool in Java. Multi-threaded and multi-process programmings are great ways to optimize CPU usage and get things done quickly. What is thread pool? Thread pool is a collection of already created worker threads ready to perform certain tasks. Instead of creating and discarding thread once the…

Convert PDF To Image File Using Java

Introduction This tutorial will show you how to convert pdf to image file using Java. For this I am using here pdfbox API. Java pdf to image example will show you step by step conversion procedure from PDF file to image file. In the recent version (2.0.20) of the pdfbox library many methods were removed along with getAllPages() and convertToImage()…

Convert Image To PDF File Using Java

Introduction This tutorial will show you how to convert image to pdf file using Java programming language. For this I am using here itext API. The example Java image to pdf file will show you step by step procedures for image to pdf conversion. I will build the application using both gradle and maven tools. In this example I will…

Java 8 : Iterate Map And Add To List

Here I will show you how to iterate Map in Java 8 and add element to List. I came across a situation where I required to fetch data from a HashMap and add it to an ArrayList. So I will show you here how to iterate a Map and form an object and finally add it to the List using…