title: Get first 5 elements from a vector
body: <p>I am having a <code>Vector</code> in my <code>multithreaded</code> env  and i need to get its first 5 elements to pass to a <code>threadpool</code></p>
  
  <p>. is there any best practice around this ? ( i mean using java util classes ) </p>
  
  <p>I can do it inside a <code>synchronized</code> block and loop through the vector until i find the first 5 elements. i am wondering is that the correct way to do it.</p>
  
  <p>please advice me.</p>
  
  <p>UPDATED SECTION ------</p>
  
  <p>please find my actual problem i need to solve.</p>
  
  <ol>
  <li><p>class A will have a vector ( sorted according to the priority. this will update in heigh frequency. i need to get the first 5 elements)</p></li>
  <li><p>class B will have the <code>myOwnThreadPool</code> that extend the <code>java.util.ThreadPoolExecutor</code> and override it's <code>afterExecute</code> method. (pool size will be 5 )</p></li>
  <li><p>class A will get the first 5 elements from the vector and send it to the class B pool to process.</p></li>
  <li><p>once <code>afterExecute</code> method notified that one thread is returned i will pick the first most element from the <code>vector</code> ( in class A / with the most priority ) and send it to the pool to process.</p></li>
  </ol>
  
  <p>I think now my question gives a better idea for you all.</p>
  
  <p>Thank you all for the answers/guidance and further suggestions are very much welcome. </p>