title: Elegant way to assign object id in Java
body: <p>I have a class for objects ... lat's say apples.</p>
  
  <p>Each apple object mush have a unique identifier (id)... how do I ensure (elegantly and efficiently) that newly created has unique id.</p>
  
  <p>Thanks</p>