Home » Java » Core Java

Core Java

Creating a JUnit 5 ExecutionCondition

Introduction JUnit 5 has a lot of underutilized features. Developers have learned how to use JUnit 4, and they utilize the same feature set when using JUnit5. The sexy DisplayName annotation is used more and more, but the majority of the new features developers skip. In this article, I describe a particular situation I was facing and how I solved ...

Read More »

Json Patch and Json Merge Patch in Java

 Json Patch and Json Merge Patch both do one job well – a way to represent a change to a source json structure.   Json Patch does it as a series of operations which transforms a source document and Json Merge Patch represents the change as a lite version of the source document. It is easier to show these as an ...

Read More »

[MEGA DEAL] The 2021 Java Bootcamp Bundle(96% off)

Develop Expertise on the Leading Programming Language & Create Actual Programs with 10 Hours of Content on Java Fundamentals, Collections, Classes, and More Hey fellow geeks, This week, on our JCG Deals store, we have another extreme offer.We are offering a massive 96% off on The 2021 Java Bootcamp Bundle. Get it now with only $35,99 instead of the original ...

Read More »

Java 8 Parallel Streams – Custom Thread Pools Examples

A brief intro to custom thread pools and their use in Java 8 parallel streams. Examples on how to use custom pools with the Parallel streams API which avoids common thread pool usage. 1. Introduction In this tutorial, You’ll learn how to create custom thread pools in Java 8 for bulk data processing with parallel streams powerful API. Parallel Stream ...

Read More »

Java 8 – How To Read A File?

A quick guide on how to read the file in older java and new JDK 8 version with example programs. 1. Overview In this tutorial, We’ll learn how to read a file line by line in java and print the files content onto console with example program. First, let us use the older java version for example demonstration and next ...

Read More »

Java 16 Records with JPA and jOOQ

Java Records The new Java version 16 includes a new feature: Records https://openjdk.java.net/jeps/395 “Enhance the Java programming language with records, which are classes that act as transparent carriers for immutable data. Records can be thought of as nominal tuples.” Let’s try Java records with JPA and jOOQ. JPA Constructor Expression One way to use projection in JPA queries is using the constructor expression. ...

Read More »

Looking into the JDK 16 vector API

JDK 16 comes with the incubator module jdk.incubator.vector (JEP 338) which provides a portable API for expressing vector computations. In this post we will have a quick look at this new API. Note that the API is in incubator status and likely to change in future releases. Why vector operations? When supported by the underlying hardware vector operations can increase ...

Read More »

Java 16: Stream.toList()

Java 16 introduces a handy new Stream.toList() method which makes it easier to convert a stream into a list. The returned list is unmodifiable and calls to any mutator method will throw an UnsupportedOperationException. Here is some sample code: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 import java.util.stream.Stream; import static java.util.stream.Collectors.*; ...

Read More »