Since @SuppressWarnings uses RetentionPolicy.SOURCE, we cannot use it as a criteria for determining whether something in the codebase is correctly serialized, leading to, for example, #17622.

It would be nice to improve this test. It's possible that ArchUnit may be an option to inspect the source code.