title: Create multiple instances of a class, but keep them unique based on a specific attribute (multiple "singletons")
body: <p>I'm rather new to Java and struggling about following:</p>
  
  <p>I have a class that creates objects, in which different data (lists) are kept. The data is always assigned to one very identifier (attribute):</p>
  
  <pre><code>class History {
      private String identifier;
  
      private ArrayList&lt;ObjectsRelatedToIdentifier&gt; objectsRelatedToIdentifier;
  }
  </code></pre>
  
  <p>I now need to have one object per identifier (X, Y, Z, etc.) but only one. It should not be possible to instantiate two objects with identifier X.</p>
  
  <p>Also, i need to be able to access those objects from other objects. How do I keep "hold" of them?</p>
  
  <p>The internals of those objects is always the same, only the identifier is different and of course the values in the ArrayList.</p>
  
  <p>Is there some kind of "multiple singleton pattern" or a combination of different patterns?</p>