Home » JVM Languages » Kotlin


Kotlin infix functions

What are infix functions? If you are using Kotlin chances are high you already used infix functions. Maybe without knowing it. When calling infix functions it is possible to omit the dot and the parentheses. So instead of 1 car.move(forward) we can write: 1 car move forward Here are a few examples of commonly used infix functions in Kotlin. The ...

Read More »

Join Two Lists in Kotlin

A quick programming guide to join two lists in kotlin. Joining two lists or ArrayList can be done using List addAll() or apache commons ListUtils.union() method and show examples on each method. 1. Introduction In this article, You’ll learn how to join two lists in kotlin programming language. List api has addAll() method and apache ListUtils.union() method to add two ...

Read More »

Advanced Creation of Hamcrest Matchers in Kotlin

This article is a rewrite of an older one done in Java. This one is done in Kotlin instead. Intro Last time, I went over what a Hamcrest Matcher was, how it’s used, and how to make one. In this article, I will explain more advanced steps in the creation of Hamcrest Matchers. First, I’ll share how to make your ...

Read More »

How to Make Your Own Hamcrest Matchers in Kotlin

This article is a rewrite of an older one done in Java. This one is done in Kotlin instead. Intro to Hamcrest Matchers First things first, I should quickly explain what a Hamcrest Matcher is. When doing unit testing, the built-in assertion types that come with the testing framework are generally pretty limited. They make it very easy for a ...

Read More »

Project reactor – de-structuring a Tuple


Tuples are simple data structures that hold a fixed set of items, each of a different data type. Project Reactor provides a Tuple data structure that can hold about 8 different types. Tuples are very useful, however one of the issues in using a Tuple is that it is difficult to make out what they hold without de-structuring them at ...

Read More »

Kotlin Data Classes: Why, What and How?

In this post on Kotlin’s data classes, we’ll take a look at how data classes are better than regular Java POJO (Plain Old Java Object) classes, and how they make our everyday lives easier. We’ll also take a look at some of the caveats of data classes. I’ve also written an article on Java vs Kotlin, if you’re interested, check ...

Read More »

Implementing multiple interfaces through delegation

In Kotlin, a class can implement multiple interfaces. This is common knowledge. A class can also use delegation to implement numerous interfaces where the implementations come from any delegated objects passed into the constructor. For example: 01 02 03 04 05 06 07 08 09 10 11 class GeneticExperiment(human: Human, animal: Animal) : Human by human, Animal by animal   ...

Read More »

The potential traps in Kotlin’s Data Classes

The aim of this post is not to point out some massive flaws in Kotlin’s design of data classes and show you how to get passed them. Actually, it is quite the opposite. The contents of this post are clearly documented in the Kotlin docs. I am merely here to highlight this information to anyone who has not noticed precisely ...

Read More »

Verifying a Contract with CSV data

Attachments in Corda can be more than just PDFs sent along with a transaction. They can actually be used programmatically when running a flow or even inside of a contract’s verify function. Why would you want to do that though? 🤔 The answer makes a lot of sense when you think about it. Let’s take an attachment containing CSV data ...

Read More »