title: Merging methods that get Lists from type <? extends Number>
body: <p>I wrote 4 methods that calculate the average of a List.
  Can I merge these methods in any way ? I'd like to have a single method that is like </p>
  
  <pre><code>private double getAverage(@NotNull List&lt;? extends Number&gt; list) {
      //magic code from stackoverflow
  }
  </code></pre>
  
  <p>Currently this is what I did:</p>
  
  <pre><code>    private double getAverageDouble(@NotNull List&lt;Double&gt; list) {
      double result = 0;
  
      for (Double value : list) {
          result += value / (double)list.size();
      }
      return result;
  }
  
  
  
  private double getAverageFloat(@NotNull List&lt;Float&gt; list) {
      double result = 0;
  
      for (Float value : list) {
          result += value / (double)list.size();
      }
      return result;
  }
  
  
  
  
  private double getAverageInteger(@NotNull List&lt;Integer&gt; list) {
      double result = 0;
  
      for (Integer value : list) {
          result += value / (double)list.size();
      }
      return result;
  }
  </code></pre>
  
  <p>Same for Long...</p>