<p>Is there a better way to negate a boolean in Java than a simple if-else?</p>

<pre><code>if (theBoolean) {
    theBoolean = false;
} else {
    theBoolean = true;
}
</code></pre>

```
```
theBoolean = !theBoolean;
```
```