For the life of me I can't figure out why I can't find the
thread where I once asked about Type Witnesses and was instructed that they used to be marginally useful, but for reasons I don't remember have become just a Trivia Answer in
Java 8 and beyond and we can pretty much forget about them as long as we don't freak out when we see them on exams or in older code.
They are mentioned in the 816/819 Sybex book, in that context...one answer choice to a mock question is:
Helper.<NullPointerException>printException( new NullPointerException ("D") );
Option D uses an odd syntax by explicitly listing the type, but you should be able to recognize it as acceptable.
Is that what I should be remembering?
"When you stick a <Classname> between the . after the name of a class (for calling a static method) or the reference and the name of the method you are calling from it, that's this old thing called a Type Witness. It used to be marginally useful, but for reasons you don't need to know if you don't care for trivia, you basically don't need them anymore in Java 8. Don't freak out if you see them in older code or on an exam"?