Ted: Trust me, I dated Robin for a year. If you don't want to lose her, you've got to try a little harder. Be more attentive to where she is emotionally, just be present.
Barney: Yes, totally. Only thing, and this is just me: I like my testicles attached to my body, rather than rolling around next to some eyeliner in Robins purse.
Ted: Wow, you were just like the worst student in the world, weren't you?
Barney: They said I had AD... something.
Ted: It's funny, when you date someone, it's like you're taking one long course in who that person is, and then when you break up, all that stuff becomes useless. It's the emotional equivalent of an English degree.
When Ted is about to leave the classroom, Barney stands up on his chair and says "Oh, Captain, my Captain". This is a reference to the movie Dead Poets Society, where all the students stand up on their desks and say "Oh, Captain, my Captain" to show support for their teacher.