One of the tools for writing proper benchmark tests is JMH. Let's say we want to compare performance of searching an element in HashSet vs TreeSet.
The easiest way to get JHM into your project - is to use maven and shade plugin. Also you can see pom.xml from JHM examples.
<build>
<pl...