-
Recent Posts
Archives
Categories
Meta
Advertisements
Java 8 has introduced a nice feature, default (so-called “defender”) methods in interfaces. These methods are implemented in the interface, but can be overridden. Now how can we unit-test these default methods? A naive approach would be: in your unit test … Continue reading
Here’s an overview of the different methods to identify a type or Object in Java. There are three basic cases I want to detect if two variables point to Objects of the same type I want to detect if two … Continue reading
Today I wrote two different Guava Collections as answer to two different StackOverflow Questions: Java data Structure and Comparator and equals() The first requested a Map where the keys are Enums and the values are sorted collections. In my answer, … Continue reading
If you want to set system properties through XML configuration, here is a solution (inspired by this question): Use two MethodInvokingFactorybeans, one to statically access System.getProperties() and one to call properties.putAll(map) on these properties. Here’s the configuration: <bean class=”org.springframework.beans.factory.config.MethodInvokingFactoryBean”> … Continue reading
Triggered by the StackOverflow Question Wicket : Notify if page model has been changed., here is a wicket behavior that you can attach to a form and that will stop the user from leaving the site once he has changed … Continue reading
I have recently come across LessCSS, a CSS meta-language that introduces code re-usability. I have been looking for a solution like this for some years now, as I hate having to write the same stuff over and over again. So … Continue reading
Again, prompted by a Stackoverflow question, here is a means to deploy an entire directory including subdirectories to a maven repository. I am using GMaven (groovy scripts embedded in maven), a great way to script and interact with maven without … Continue reading