It really depends on the company and your role.
If you are entry level, I can see testing you on this since it should be fresh in your mind from school and you probably know nothing anyway.
If you have been coding for 5-6 years doing annotations and configuration heavy java code. Chances are you remember nothing and will need to study up. To me, this is completely useless and if your job doesnt entail doing this, I have no idea why they ask these questions.
I think what would be a far better option would be to ask you a few algorithm questions, give you a packet to study, then invite you back to test again. Because in my mind the biggest indicator of success as a programmer is the ability to learn new things in a short period of time.
I think this is why companies like google still ask these questions (in addition to being a remnant from the times when every developer at google worked intimately with complex data structures) is that they want to see if you can learn it. I don't think anyone there has delusions that anywhere close to 100 percent of their accepted applicants knew this stuff before the interview process, but again I think they want to know if they can learn it quickly