Document legimitate uses, and clean up the containing test classes
(which mostly involves disabling IntelliJ's warnings about invalid
uses of equals()).
Clean up a few only-null variables and a couple of other small
issues.
Change-Id: I7a6177b266589c15b9b169a99a9f2a9054da94ed Signed-off-by: Stephen Kitt <skitt@redhat.com>