Yesterday I had a technical interview and one of the tasks was to explain the test example below. Is this possible and in which cases? 

```
void test() {
   A a = new A();
   B b = new B();
   C c = new C();

   HashSet set;

   set = new HashSet();
   set.add(a);
   set.add(b);
   set.add(c);
   assert set.size() == 3;

   set = new HashSet();
   set.add(a);
   set.add(c);
   set.add(b);
   assert set.size() == 2;
}

```

Please help me!