Your problem is this line.
this.next = new Name();
You're adding a new "empty object" onto the back of every Name
that you add. Remove it and you'll get the desired result. (I assume you also have Name extends Employee
in there somewhere, otherwise this doesn't compile).