How do I write a correct micro-benchmark in Java?

How do you write (and run) a correct micro-benchmark in Java?

I’m looking here for code samples and comments illustrating various things to think about.

Example: Should the benchmark measure time/iteration or iterations/time, and why?

Related: Is stopwatch benchmarking acceptable?