title: How Law of Demeter and Vector interacts?
body: <p>So i have this code:</p>
  <pre><code>Public class Worker{
     private String gender;
     ...
     public Boolean isMale(){
        return gender==&quot;Male&quot;;
     }
  }
  
  Public class Business{
     private Vector&lt;Worker&gt; vWorkers;
     ...
     public void showMaleWorkers(){
        for(Integer I=0; I&lt;vWorkers.size();I++){
           if(vWorkers.elementAt(I).isMale()){
           ...
           }
        }
     }
  }
  </code></pre>
  <p>Is the &quot;if&quot; breaking the law of demeter and if yes how could I solve it?</p>