I just found this code that I thought was humorous (identifiers changed to protect intellectual property): private boolean allFoosAreBarsOrBazs() { for (Foo foo: foos) { if (!(foo instanceof Bar)) { if (!(foo instanceof Baz)) { return false; } } if (!(foo instanceof Baz)) { if (!(foo instanceof Bar)) { return false; } } } return true; }