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.
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.
Problem: How to inject null value in Spring Framework? This can be easily done using Spring Expression Language as in the following example.
Problem: How to use Maven to package a project with dependencies? The solution is to use maven-assembly-plugin as in the following example.
Problem: 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.
Problem: 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.
Problem: How to reverse Java List when List doesn’t have such method? As usually the solution is in Java Collections API.
In this post we show common Spock Framework Maven/Gradle configurations ready to use in your projects and in the rest of the Spock Tutorial.
Problem: How to create “Hello, World” app in Spring Boot?
Problem: How to test Spring Rest Controller?