-
Core Java
Hazelcast’s MapLoader pitfalls
One of the core data structures provided by Hazelcast is IMap<K, V> extendingjava.util.concurrent.ConcurrentMap – which is basically a distributed map,…
Read More » -
Groovy
Property-based testing with Spock
Property based testing is an alternative approach to testing, complementing example based testing. The latter is what we’ve been doing…
Read More » -
Enterprise Java
URL shortener service in 42 lines of code in… Java (?!) Spring Boot + Redis
Apparently writing a URL shortener service is the new “Hello, world!” in the IoT/microservice/era world. It all started with A…
Read More » -
Core Java
Testing code for excessively large inputs
When writing unit tests we mostly focus on business correctness. We do our best to exercise happy path and all…
Read More » -
Core Java
Grouping, sampling and batching – custom collectors in Java 8
Continuing first article, this time we will write some more useful custom collectors: for grouping by given criteria, sampling input, batching…
Read More » -
Core Java
Building extremely large in-memory InputStream for testing purposes
For some reason I needed extremely large, possibly even infinite InputStream that would simply return the samebyte[] over and over. This way I…
Read More » -
Core Java
Introduction to writing custom collectors in Java 8
Java 8 introduced the concept of collectors. Most of the time we barely use factory methods from Collectors class, e.g. collect(toList()), toSet() or maybe something…
Read More » -
Core Java
Turning recursive file system traversal into Stream
When I was learning programming, back in the days of Turbo Pascal, I managed to list files in directory usingFindFirst, FindNext and FindClose functions.…
Read More » -
Scala
Option.fold() considered unreadable
We had a lengthy discussion recently during code review whether scala.Option.fold() is idiomatic and clever or maybe unreadable and tricky?…
Read More »