I was under impression that a private inner/nested class is only used for/by/accessed by outer class. But experimenting I realized that the HashSet(which is not the outer class of Happy) can access the class. If so then what is the real use of `private` ? Is it only restricting *creation* of classes to within outer class ? 

```
public class FreeMain {

    private static class Happy {
       int x; 
       private Happy(int x) {
           this.x = x;
       }

       @Override
       public boolean equals(Object o) {
           return true;
       }

       @Override
       public int hashCode() {
           return 10;
       }
    }

    public static void main(String[] args) {
        Set<Happy> happiness = new HashSet<Happy>();

        Happy h1 = new Happy(10);
        Happy h2 = new Happy(20);

        happiness.add(h1);
        happiness.add(h2);
    }   
}

```