code: public Docket genericModelSubstitutes(Class... genericClasses) {
      for (Class clz : genericClasses) {
        this.ruleBuilders.add(newGenericSubstitutionFunction(clz));
      }
      return this;
    }
docs: Substitutes each generic class with it's direct parameterized type. Use this method to
  only for types with a single parameterized type. e.g. <code>List&lt;T&gt; or ResponseEntity&lt;T&gt;</code>
  <code>.genericModelSubstitutes(ResponseEntity.class)</code>
  would substitute ResponseEntity &lt;MyModel&gt; with MyModel
  
  @param genericClasses - generic classes on which to apply generic model substitution.
  @return this Docket