title: using java Stream to get a sum, average, and sort
body: <p>I am studying java Stream and having hard time solving questions below. The reason why I got stuck is because I have no idea about dealing with <code>Stream&lt;Integer&gt;</code>.</p>
  
  <p>I stumbled upon a solution of "count" by doing <code>list.stream().count()</code>, but other than this, I can't proceed further. Please help me how to deal with these problems and tell me why <code>list.stream().count()</code> works in this situation. So far, I've tried everything I've learned.</p>
  
  <pre><code>public class Question {
      public static void main(String[] args) {
          List&lt;Integer&gt;list = Arrays.asList(5,3,4,1,2);
          System.out.println("sum by using Stream : " + sum);
          System.out.println("count by using Stream: " + count);
          System.out.println("average by using Stream : " + avg);
          System.out.println("sort by using Stream");
      }
  }
  </code></pre>