title: Toggling boolean value, but just once? (java)
body: <p>Every now and then there is a need to store a boolean value only once (to record that it has changed from false to true or vice versa) in a loop, while executing the loop to the end but not caring anymore about changes in the boolean value. Example:</p>
  
  <pre><code>
      public static boolean dbDelete(Collection argObjectCollectionToDelete) {
          boolean result = true;
          for (Object object : argObjectCollectionToDelete) {
              boolean dbDelete = dbDelete(object);
              if (!dbDelete) {
                  result = false;
              }
          }
          return result;
      }
  </code></pre>
  
  <p>Is there some way to execute the equivalent of the code</p>
  
  <pre><code>
  if (!dbDelete) {
      result = false;
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>
  if (!dbDelete && !result) {
      result = false;
  }
  </code></pre>
  
  <p>in a more elegant way, preferrably in one line?</p>