title: To use break in a for loop or not?
body: <p>Just one quick question, say, Car class extends HashMap(String, String).</p>
  
  <p>1.</p>
  
  <pre><code>for (Car car : carList) {
      if (car.isEmpty) {
          break;
      }
      doSomething();
  }
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>for (Car car : carList) {
      if (!car.isEmpty) {
          doSomethingElse();
      }
  }
  </code></pre>
  
  <p>Which of the above two is better?
  Thanks.</p>
  
  <p>---- edited ----
  Sorry I did not make my point clear.</p>
  
  <p>The doSomething() method is actually doing different things.
  I've changed them to doSomething() and doSometingElse().</p>
  
  <p>My question is, will you put all the process in one if()? or first break the loop if the if() condition does not satisfy.</p>
  
  <p>Thanks.</p>