title: Java List - Best way to insert or replace
body: <p>So I was wondering what would be the best way to</p>
  
  <ul>
  <li>perform an insert if an element does not yet exist</li>
  <li>perform an update if an element already exists</li>
  </ul>
  
  <p>Maybe a list is not the best data structure for such a use case?</p>