Home » Author Archives: Mohammad Meraj Zia

Author Archives: Mohammad Meraj Zia

Mohammad Meraj Zia
I did my Engineering in Information Technology from IET, Lucknow, India. Currently doing MSc in Information Technology from Derby University. I have worked in Java/J2EE domain for the last 10 years. Have good understanding of Payment and Finance domains.

How to use WireMock for Mocking

In this article we will learn about WireMock for mocking. WireMock is a simulator for HTTP-based APIs. Some might consider it a service virtualization tool or a mock server. It enables you to stay productive when an API you depend on doesn’t exist or isn’t complete. It supports testing of edge cases and failure modes that the real API won’t reliably produce. ...

Read More »

Java 8 Convert a primitive Array to List Example

In this article we will learn how to Convert a primitive Array to List using Java 8. For this example we will use IDEA IntelliJ but you can also use any IDE. 1. Introduction An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the ...

Read More »

Java 8 Display all ZoneId and its UTC offset Example

In this article we will see how to display all ZoneId and its UTC offset. A ZoneId is used to identify the rules used to convert between an Instant and a LocalDateTime. 1. Introduction The java.time package contains the main APIs for dates, times, instants and duration. The classes defined here represent the principle date-time concepts, including instants, durations, dates, times, ...

Read More »

Java 8 Convert Instant to ZonedDateTime Example

In this post, we feature a comprehensive Example on Java 8 Convert Instant to ZonedDateTime. We will discuss about the Java Instant and ZonedDateTime classes and how we can convert a time represented by the Instant to a ZonedDateTime object. 1. Java 8 Convert Instant to ZonedDateTime – Introduction First we will have a look at the Instant class. java.time.Instant ...

Read More »

Java 8 Convert Instant to LocalDateTime Example

In this post, we feature a comprehensive Example on Java 8 Convert Instant to LocalDateTime. First we will learn about Java Instance and LocalDateTime class and then how to convert an Instant object to LocalDateTime. 1. Introduction First we will have a look at the Instant class. java.time.Instant This class models a single instantaneous point on the time-line. This might ...

Read More »

Java 8 Period and Duration Example

In this article we will learn about the Duration and Period classes in Java. These classes were added in Java 8. 1. Introduction A Duration measures an amount of time using time-based values (seconds, nanoseconds). A Period uses date-based values (years, months, days). Duration public final class Duration extends Object implements TemporalAmount, Comparable<Duration>, Serializable A Duration represents a time-based amount ...

Read More »

Java RunnableScheduledFuture Example

In this article we will learn about java.util.concurrent.RunnableScheduledFuture class which was introduced in Java 6. 1. Introduction Java RunnableScheduledFuture is a ScheduledFuture that is Runnable. Successful execution of the run method causes completion of the Future and allows access to its results. public interface RunnableScheduledFuture<V> extends RunnableFuture<V>, ScheduledFuture<V> To know how RunnableScheduledFuture works first we need to learn about java.util.concurrent.Future. 1.1 ...

Read More »

Java 9 Jshell Tutorial

1. Introduction In this article we will learn about Java 9 Jshell. The Java Shell tool (JShell) is an interactive tool for learning the Java programming language and prototyping Java code. JShell is a Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions as they are entered and immediately shows the results. The tool is run from the command line. Using ...

Read More »

IntelliJ IDEA Code Review Example

In this post, we feature a comprehensive Example on IntelliJ IDEA Code Review. We will learn how we can use IDEA IntelliJ for code reviews. 1. Introduction Code review is systematic examination (sometimes referred to as peer review) of computer source code. It is intended to find mistakes overlooked in software development, improving the overall quality of software. Reviews are ...

Read More »

Spring Security OAuth2 Example

In this article we will learn how to integrate OAuth2 with Spring Security. 1. Introduction Spring Security is a powerful and highly customisable authentication and access-control framework. It is the de-facto standard for securing Spring-based applications. It is a framework that focuses on providing both authentication and authorisation to Java applications. Like all Spring projects, the real power of Spring ...

Read More »