title: Collection for Generic types
body: <p>How can I represent the generic types in a single collection? </p>
  
  <pre class="lang-java prettyprint-override"><code>public interface Rule&lt;T&gt; {
    String execute(T dataProvider);
  }
  
  public interface DataProvider {
     // No common functions as of now
  }
  
  public class RulesExecutor {
       private Map&lt;String, List&lt;Rule&gt;&gt; documentToRuleListMap;
      public RulesExecutor(Map&lt;String, List&lt;Rule&gt;&gt; documentToRuleListMap) {
          this.documentToRuleListMap = documentToRuleListMap;
      }
  
      public executeRules(DataProvider dataProvider, String document) {
        // some logic here 
      }
  }
  </code></pre>
  
  <p>Is it possible to store a map as shown in <code>RulesExecutor</code> sconstructor?</p>
  
  <p>If not, what is the correct data structure to store this info in?</p>