Impl of linkedlist in java