Efficient Word Frequency Calculator in Java
1. Overview In this tutorial, we’ll show various ways of implementing a word counter in Java. 2. Counter Implementations Let’s start by simply calculating the word count of words in this array: static...
View ArticleA Guide to EclipseLink with Spring
1. Overview By default, Spring Data uses Hibernate as the default JPA implementation provider. However, Hibernate is certainly not the only JPA implementation available to us. In this article, we’ll...
View ArticleJUnit 5 @Test Annotation
1. Overview In this article, we’ll make a quick review of JUnit’s @Test annotation. This annotation provides a powerful tool for performing unit and regression testing. 2. Maven Configuration To use...
View ArticleJava Weekly, Issue 208
Lots of interesting writeups on Java 9 this week. Here we go… 1. Spring and Java >> Maven on Java 9 – Five Things You Need To Know [blog.codefx.org] The combination of Java 9’s JPMS with Maven...
View ArticlePrimitive Type Streams in Java 8
1. Introduction The Stream API was one of the key features added in Java 8. Briefly, the API allows us to process collections and other sequences of elements – conveniently and more efficiently – by...
View ArticleRecursion In Java
1. Introduction In this article, we’ll focus on a core concept in any programming language – recursion. We’ll explain the characteristics of a recursive function and show how to use recursion for...
View ArticleA Simple File Search with Lucene
1. Overview Apache Lucene is a full-text search engine, which can be used by various programming languages. To get started with Lucene, please refer to our introductory article here. In this quick...
View ArticleHow to Invert an Array in Java
1. Overview In this quick article, we’ll show how we can invert an array in Java. We’ll see a few different ways to do this using pure Java 8-based solutions – some of those mutate an existing array...
View ArticleJava 9 Variable Handles Demystified
1. Introduction Java 9 brought a number of new useful features for developers. One of those is the java.lang.invoke.VarHandle API – representing variable handles – which we’re going to explore in this...
View ArticleIntro to Performance Testing using JMeter
1. Overview In this article, we’re going to use Apache JMeter to configure and run performance tests. 2. Setting up JMeter Let’s download JMeter, unzip it, go to the bin folder and run the executable...
View ArticleGuide to the Cipher Class
1. Overview Simply put, encryption is the process of encoding a message such that only authorized users can understand or access it. The message, referred to as plaintext, is encrypted using an...
View ArticleConfigure Jenkins to Run and Show JMeter Tests
1. Overview In this article, we’re going to configure a continuous delivery pipeline using Jenkins and Apache JMeter. We’ll rely on the JMeter article as a great starting-point to first understand the...
View ArticleA Guide to Java Initialization
1. Overview Simply put, before we can work with an object on the JVM, it has to be initialized. In the following sections, we’ll take a look at various ways we can initialize primitive types and...
View ArticleHow to Wait for Threads to Finish in the ExecutorService
1. Overview The ExecutorService framework makes it easy to process tasks in multiple threads. We’re going to exemplify some scenarios in which we wait for threads to finish their execution. Also,...
View ArticleFail-Safe Iterator vs Fail-Fast Iterator
1. Introduction In this article, we’ll introduce the concept of Fail-Fast and Fail-Safe Iterators. Fail-Fast systems abort operation as-fast-as-possible exposing failures immediately and stopping the...
View ArticleGuide to JSpec
1. Overview Test runner frameworks like JUnit and TestNG provide some basic assertion methods (assertTrue, assertNotNull, etc.). Then there are assertion frameworks like Hamcrest, AssertJ, and Truth,...
View ArticleStatic and Default Methods in Interfaces in Java
1. Overview Java 8 brought to the table a few brand new features, including lambda expressions, functional interfaces, method references, streams, Optional, and static and default methods in...
View ArticleQuick Guide to BDDMockito
1. Overview The BDD term was coined first by Dan North – back in 2006. BDD encourages writing tests in a natural, human-readable language that focuses on the behavior of the application. It defines a...
View ArticleJava Weekly, Issue 209
Here we go… 1. Spring and Java >> JUnit 5 Tutorial: Writing Parameterized Tests [petrikainulainen.net] Finally, no need to use external tools for writing parameterized tests in JUnit. >>...
View ArticleIntroduction to KafkaStreams in Java
1. Overview In this article, we’ll be looking at the KafkaStreams library. KafkaStreams is engineered by the creators of Apache Kafka. The primary goal of this piece of software is to allow...
View Article