I came across this type of casting on java oracle tutorial
for (WatchEvent<?> event: key.pollEvents()) {
...
...
WatchEvent<Path> ev = (WatchEvent<Path>)event;
My understanding that since the event reference generic type is defined as anything extend Object, so it's self-explained that since Path extends Object indirectly.
But I have searched on java specification about any rules of casting generic type that explains the above case and all related cases but I didn't find anything.
First, is my explanation is right? Second, is there any reference or DOC about this and similar cases?