title: To use nested genericized collections or custom intermediate classes?
body: <p>Before the introduction to generics to the Java language I would have written classes encapsulating collections-of-collections-of-collections. For example:</p>
  
  <pre><code>class Account {
     private Map tradesByRegion; //KEY=Region, VALUE=TradeCollection
  }
  
  class TradeCollection {
     private Map tradesByInstrument; //KEY=Instrument, Value=Trade
  }
  </code></pre>
  
  <p>Of course, with generics, I can just do:</p>
  
  <pre><code>class Account {
     private Map&lt;Region, Map&lt;Instrument, Trade&gt;&gt; trades;
  }
  </code></pre>
  
  <p>I tend to now opt for option #2 (over a <em>generified version of option #1</em>) because this means I don't end up with a proliferation of classes that exist solely for the purpose of wrapping a collection. But I have a nagging feeling that this is bad design (e.g. how many nested collections should I use before declaring new classes). Opinions?</p>