Skip to content

Instantly share code, notes, and snippets.

View ohubaut's full-sized avatar

Olivier Hubaut ohubaut

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ohubaut on github.
  • I am ohubaut (https://keybase.io/ohubaut) on keybase.
  • I have a public key ASBEVyTJwAQjHDzzJGZ791hrTEZOXT3fsrPG4xrxxhkFXAo

To claim this, I am signing this object:

@ohubaut
ohubaut / gist:700894
Created November 15, 2010 20:36
Try running this in java, you'll obtain 10 as output (autoboxing trap). Run the same in Groovy 1.7.5 will give you 2 as output
import java.util.HashSet;
import java.util.Set;
public class TestAutoboxing {
public static void main(String[] args) {
Set<Short> testSet = new HashSet<Short>();
short counter=0;
while (counter<10)
{