title: wait until all threads finish their work in java
body: <p>I'm writing an application that has 5 threads that get some information from web simultaneously and fill 5 different fields in a buffer class.<br>
  I need to validate buffer data and store it in a database when all threads finished their job.<br>
  How can I do this (get alerted when all threads finished their work) ?  </p>