title: What are the best practices for benchmarking different Java collections?
body: <p>I have couple interesting Java collections in my hand such as:</p>
  
  <ol>
  <li><a href="http://code.google.com/p/guava-libraries/" rel="noreferrer">http://code.google.com/p/guava-libraries/</a></li>
  <li>Java 7</li>
  <li>Java 7 concurrent collections</li>
  <li>Scala collections</li>
  <li>Homegrown collections that we have at some company</li>
  </ol>
  
  <p>I wonder what would be the best practices to test these API's, from a performance and scalability perspective, i.e. which one is fastest, most scalable, performant, etc.  Should I set with million(s) of random elements and use timer or something else?  Just wanted to satisfy my curiosity and see which one would win.</p>