Fix quality flaws: "Collapsible "if" statements should be merged".
Fix quality flaws.
Fix quality flaws: "Strings literals should be placed on the left side when checking for equality".
Fix quality flaws: "Collection.isEmpty() should be used to test for emptiness".
Fix quality flaws.