Problem: How to implement equals and hashcode using java.util.Objects? In the following example we show how to use these great, null-insensitive helper methods.
Continue reading Java Objects equals hashcodejava
Problem: How to print Java object using custom format? Since Java 5 there’s Formattable interface exactly for that purpose. Here’s an example of how to use it.
Continue reading Java Formattable exampleProblem: How to inject null value in Spring Framework? This can be easily done using Spring Expression Language as in the following example.
Continue reading Spring inject null valueProblem: How to use Maven to package a project with dependencies? The solution is to use maven-assembly-plugin as in the following example.
Continue reading Maven package with dependenciesProblem: How to find annotated classes in Java? JDK by itself doesn’t provide such mechanism, but there are libraries that can do that. One of them is Reflections, which is used in the following example.
Continue reading Java find annotated classesProblem: How to find annotated classes using Spring and read metadata from them? Sometimes you may want to attach metadata to your classes using custom annotations. Here’s an example how you can leverage Spring‘s classpath scanning mechanism to do that.
Continue reading Spring find annotated classesProblem: How to reverse Java List when List doesn’t have such method? As usually the solution is in Java Collections API.
Continue reading Java reverse ListIn this post we show common Spock Framework Maven/Gradle configurations ready to use in your projects and in the rest of the Spock Tutorial.
Continue reading Spock Framework Maven Gradle SetupProblem: How to create “Hello, World” app in Spring Boot?
Continue reading Spring Boot “Hello, World”Problem: How to test Spring Rest Controller?
Continue reading Spring Rest Controller Testing