Core Java
-

Optional Dependencies
Sometimes a library you are writing may have optional dependencies. E.g. “if apache http client is on the classpath, use…
Read More » -

Netty: Testing encoders/decoders
I’ve been working with Netty a bit recently and having built a pipeline of encoders/decoders as described in this excellent…
Read More » -

How LongAccumulator and DoubleAccumulator classes work?
Two classes new in Java 8 deserve some attention: LongAccumulator and DoubleAccumulator. They are designed to accumulate (more on what…
Read More » -

Exception Translation with ET
Some time ago I wrote a small blog post about exception translation with AspectJ. In this blog post we will…
Read More » -

We’re Taking Bets: This Annotation Will Soon Show up in the JDK
This recent Stack Overflow question by Yahor has intrigued me: How to ensure at Java 8 compile time that a…
Read More » -

Is Getter DI A Good Idea?
Sometimes, you may hear about dependency injection done via a getter method, which subclasses override or mock frameworks fake for…
Read More » -

Transforming Collections
Did you ever want to substitute the equals and hashCode methods a HashSet or HashMap uses? Or have a List…
Read More » -

A Few Thoughts on Unit Test Scaffolding
When I start to repeat myself in unit test methods by creating the same objects and preparing the data to…
Read More » -

Puzzler: nested computeIfAbsent
Overview The Java 8 libraries have a new method on map, computeIfAbsent. This is very useful way to turn your…
Read More »

