title: Refactoring java method to reduce cyclomatic complexity
body: <pre><code>    ArrayList cars = vehicles.getExtras();
  
      Iterator it = cars.iterator();
      while(it.hasNext()){
          Extra cExtra = (Extra)it.next();
  
              if (cExtra.getExtraId()==INSURANCE)
                  insurance = cExtra.getExtra();
  
              if (cExtra.getExtraId()==ROAD_ASSISTANCE_CODE)
                  roadAssCode = cExtra.getExtra();
  
              if (cExtra.getExtraId()==TYPE)
                  replacementCarServiceType = cExtra.getExtra();
  
              if (cExtra.getExtraId()==CATEGORY)
                  replacementCarCategory = cExtra.getExtra();
  
              if (cExtra.getExtraId()==ASSISTANCE){
                  roadAssistanceCode = cExtra.getExtra();
              }
  </code></pre>
  
  <p>I have a lot more of these 'if' types that i have not included.
  How could i refactor this, so the cyclomatic complexity could be reduced.</p>