title: Cleanest way to toggle a boolean variable in Java?
body: <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>