Contrary to the explanation, "all" works very well to remove the warnings in this case. I checked this with the following jdks:Apply @SuppressWarnings("all") at //1
jdk-11.0.14 (oracle)
zulu-11-amd64
adoptopenjdk-11-hotspot-amd64
If the question means to ask what is the better way (as we all know just turning off all compiler warnings is not a good idea), it should say so. But as the question is now, @SuppressWarnings("all") on class level would be a perfectly fine answer as it removes all compiler warnings.