A better mousetrap (or, how to improve on Java 8 Optional)

Overview The java.util.Optional class is a great addition in Java 8 as it enables a more expressive way of conveying the concept of a library API return value that may not be there. While it is not meant to replace the use of null values in code (and you will get warnings not to use … More A better mousetrap (or, how to improve on Java 8 Optional)

Data-driven tests for Spring Data (MongoDB)

When testing a project that uses Spring Data repositories, we may want to insert ‘known-good’ data into arbitrary MongoDB collections, reading it, for example, from JSON iles (typically somewhere in the test/resources subtree). However, some of the data stored in Mongo is in BSON format, which extends the plain JSON format with some Object types … More Data-driven tests for Spring Data (MongoDB)

Code Reviews

As anyone who has worked with me is well aware, I’m a great believer in code reviews – there is much to be said about a number of positive impacts on the project (and the developers’ professional growth too). This is a great article that sums up very well the benefits, as well as a … More Code Reviews

Dump CPU temperature data to a file in Ubuntu

Update: I’ve figured out that it makes a lot more sense to have a reading of the CPU load to correlate with the temperature reading, so I’ve added that too using /usr/bin/uptime.I have written a very simple Java utility to take readings from the CPU temperature sensors utility (/usr/bin/sensor) and dump it to a CSV … More Dump CPU temperature data to a file in Ubuntu